Compare commits

...
1 Commits
Author SHA1 Message Date
alexrg 42f405e69c Unify La Salle sign-in experience 2026-09-22 15:03:12 -06:00
13 changed files with 96 additions and 41 deletions

No files matched your search

+15 -10
View File
@@ -13,20 +13,25 @@ Ready-to-run bootstrap packages are published on the
## Authentication contract
1. The Windows tile collects a `DO`, `AL`, or `AD` institutional key and a password.
2. It sends that exact password over mutually authenticated TLS to the broker.
3. The broker validates the same key/password pair against the lightweight SGU
NTLM root. Only an authoritative `401`/`403` rejects the credential.
4. After successful authentication, the broker makes a separately bounded,
best-effort request for the minimum available SGU profile fields.
5. On success, the broker creates or moves the AD user, updates the available
name/mail/title/department/address metadata when available, and sets the AD password
to the exact submitted password.
6. The Credential Provider serializes the original `SecureString` to Windows.
1. Windows presents one **La Salle** sign-in tile with `Usuario` and `Contraseña`.
2. The user enters a `DO`, `AL`, or `AD` key and the current password once.
3. The tile sends that exact pair over mutually authenticated TLS to the broker,
which validates it against the institutional authority. Only an authoritative
`401`/`403` rejects it.
4. On every valid sign-in, the broker performs an idempotent Active Directory
UPSERT: it creates or repairs the account, its role OU and group, supported
profile fields, and the AD password using the password just validated.
5. The Credential Provider serializes the original `SecureString` to Windows.
No derived password is created. Passwords are not written to a database, file,
event log, application log, command line, or response.
This makes Active Directory the only Windows sign-in account while preserving
automatic synchronization: if a person changes their institutional password,
the next successful La Salle sign-in updates the domain password before Windows
continues. A matching prefix alone never creates an account; the institutional
authority must first accept the submitted password.
For administrative accounts, profile enrichment first verifies the employee
number against the incident overview, then reads the structured given names and
surnames from `datos/personales.aspx` and the postal address from
+13 -6
View File
@@ -57,10 +57,17 @@ an error and does not serialize the rejected credential.
## Account synchronization
The broker normalizes the username to uppercase and accepts exactly two letters
plus six digits. It searches `BaseDn` by `sAMAccountName`, creates the user when
absent, moves it to the mapped OU when required, sets `userPrincipalName`, and
passes the submitted password directly to ADSI `SetPassword`.
The visible Windows experience is a single **La Salle** sign-in tile with
`Usuario` and `Contraseña`; the institutional authority is not a separate tile
or second password prompt. The broker normalizes the username to uppercase and
accepts exactly two letters plus six digits. After the authority accepts the
submitted password, it searches `BaseDn` by `sAMAccountName`, creates the user
when absent, moves it to the mapped OU when required, sets `userPrincipalName`,
and passes that same submitted password directly to ADSI `SetPassword`. This is
an idempotent UPSERT performed on every successful sign-in, so the next sign-in
after an institutional password change updates AD before Windows validates the
interactive logon. A matching username pattern alone never provisions an
account.
Before an account becomes usable, the broker applies explicit deny ACEs for the
Active Directory `Change Password` extended right to SELF and Everyone. Users
@@ -125,9 +132,9 @@ Windows client maps the group into its local **Remote Desktop Users** group.
Every synchronized user also receives `La Salle` in the AD
`company` attribute unless deployment configuration supplies another default.
The generic SGU credential is rendered as a dedicated branded tile instead of
The generic La Salle credential is rendered as a dedicated branded tile instead of
being grouped below the anonymous **Other user** tile. Machine policy assigns
the SGU CLSID as the default provider, hides the last signed-in identity, and
the provider CLSID as the default provider, hides the last signed-in identity, and
disables local-user enumeration while retaining the built-in Microsoft password
provider and its **Other user** recovery path. The computer GPO also applies
Windows' native default account picture to named Windows accounts; client
+4 -2
View File
@@ -232,8 +232,10 @@ administradores.
El proveedor usa un mosaico genérico dedicado, no una credencial asociada al SID
anónimo de **Other user**. Windows muestra la imagen institucional y la etiqueta
`La Salle · Acceso SGU`; el encabezado `Acceso institucional SGU`
se publica como `CPFT_LARGE_TEXT` solamente en el mosaico seleccionado. LogonUI
`La Salle`; el encabezado `Iniciar sesión` se publica como `CPFT_LARGE_TEXT`
solamente en el mosaico seleccionado. El usuario captura una sola vez `Usuario`
y `Contraseña`; la sincronización institucional y el UPSERT de Active Directory
ocurren detrás de esa misma pantalla. LogonUI
elige la familia, el peso y el tamaño final y no expone opciones de tipografía a
un Credential Provider.
+1 -1
View File
@@ -136,7 +136,7 @@ On Windows 10:
```
Use Lithnet's `Invoke-CredUI` test utility when available, or sign out/restart
the VM and select **Acceso institucional SGU**. Keep the built-in Windows
the VM and select **La Salle**. Keep the built-in Windows
password provider available through **Other user**.
On the domain controller, apply the SGU user and computer policies once:
+15
View File
@@ -0,0 +1,15 @@
# SGU Credential Provider 0.6.13
La pantalla de inicio de sesión ahora presenta una sola credencial visible:
**La Salle**, con los campos `Usuario` y `Contraseña`. Ya no muestra el texto
“Acceso Institucional SGU”.
La autenticación institucional permanece dentro del broker, sin una segunda
captura. Después de cada autenticación válida, el broker ejecuta su UPSERT de
Active Directory: crea o repara la cuenta, la OU, el grupo, los datos de perfil
disponibles y la contraseña de AD. Así, la siguiente sesión después de cambiar
una contraseña institucional sincroniza esa contraseña con el dominio.
El patrón `DO`, `AL` o `AD` con seis dígitos continúa siendo sólo un formato de
usuario. No autoriza ni crea cuentas por sí mismo: la autoridad institucional
debe validar la contraseña antes de que el UPSERT haga cambios en AD.
+1 -1
View File
@@ -97,7 +97,7 @@ usuario que cerró sesión y deshabilita la enumeración de usuarios locales en
equipo unido al dominio. No modifica ni oculta el proveedor de contraseña de
Microsoft; **Other user** permanece como ruta de recuperación.
Cerrar sesión o reiniciar el equipo. El acceso SGU debe quedar seleccionado por
Cerrar sesión o reiniciar el equipo. El acceso La Salle debe quedar seleccionado por
defecto y el proveedor de contraseña de Microsoft debe permanecer disponible.
## 5. Verificación
+2 -2
View File
@@ -303,7 +303,7 @@ if ($PSCmdlet.ShouldProcess($installPath, 'Install and register the SGU Credenti
# Windows PowerShell 5.1 interprets an UTF-8 script without a BOM using the
# current ANSI code page. Construct the middle dot from its Unicode value so
# the LogonUI registry label remains correct on every client locale.
Set-Item -Path $providerRegistryPath -Value ('La Salle {0} Acceso SGU' -f [char]0x00B7)
Set-Item -Path $providerRegistryPath -Value 'La Salle'
if (-not $DoNotSetAsDefaultCredentialProvider) {
if (-not (Test-Path -LiteralPath $defaultProviderPolicyPath)) {
@@ -316,7 +316,7 @@ if ($PSCmdlet.ShouldProcess($installPath, 'Install and register the SGU Credenti
-Force | Out-Null
}
# Do not leave a signed-out SGU identity exposed as a persistent user tile.
# Do not leave a signed-out domain identity exposed as a persistent user tile.
# The Microsoft password provider remains registered and supplies Other user.
if (-not (Test-Path -LiteralPath $interactiveLogonPolicyPath)) {
New-Item -Path $interactiveLogonPolicyPath -Force | Out-Null
+1 -1
View File
@@ -161,7 +161,7 @@ app.MapPost("/v1/authenticate", async (
AuthenticationFlowOutcome.InvalidCredentials => Results.Json(
new ErrorResponse(
result.ErrorCode ?? "INVALID_INSTITUTIONAL_CREDENTIALS",
"Credenciales institucionales inválidas."),
"Usuario o contraseña incorrectos."),
statusCode: StatusCodes.Status401Unauthorized),
_ => Unavailable(context, result.ErrorCode)
@@ -16,12 +16,12 @@ public sealed class SguCredentialProvider : CredentialProviderBase
{
yield return new CredentialProviderLabelControl(
ControlKeys.ProviderLabel,
"La Salle · Acceso SGU");
"La Salle");
yield return new CredentialProviderLogoControl(
ControlKeys.ProviderLogo,
"Acceso institucional SGU",
"Inicio de sesión La Salle",
ProviderTileIcon.Create());
yield return new LargeLabelControl(ControlKeys.Heading, "Acceso institucional SGU")
yield return new LargeLabelControl(ControlKeys.Heading, "Iniciar sesión")
{
// Isolate the CPFT_LARGE_TEXT heading from the compact provider tile
// for the selected-layout variant. LogonUI still owns the typography.
@@ -29,8 +29,8 @@ public sealed class SguCredentialProvider : CredentialProviderBase
};
yield return new SmallLabelControl(
ControlKeys.InformationLabel,
"Usa tu clave institucional (DO, AL o AD + 6 dígitos) y contraseña.");
yield return new TextboxControl(ControlKeys.UserName, "Clave institucional");
"Escribe tu usuario y contraseña.");
yield return new TextboxControl(ControlKeys.UserName, "Usuario");
SecurePasswordTextboxControl password = new(ControlKeys.Password, "Contraseña");
yield return password;
yield return new SubmitButtonControl(ControlKeys.Submit, "Iniciar sesión", password);
@@ -36,7 +36,7 @@ internal sealed class SguCredentialTile : CredentialTile3
{
if (!UserIdentityClassifier.TryParse(userNameControl.Text, out UserIdentity? identity) || identity is null)
{
return Failure("La clave debe usar DO, AL o AD seguido de seis dígitos.");
return Failure("El usuario debe usar DO, AL o AD seguido de seis dígitos.");
}
SecureString securePassword = passwordControl.Password;
@@ -67,7 +67,7 @@ internal sealed class SguCredentialTile : CredentialTile3
if (decision.Kind == BrokerDecisionKind.InvalidCredentials)
{
return Failure("Credenciales institucionales inválidas.");
return Failure("Usuario o contraseña incorrectos.");
}
string domain = decision.Kind == BrokerDecisionKind.Authorized
@@ -82,7 +82,7 @@ internal sealed class SguCredentialTile : CredentialTile3
IsSuccess = true,
StatusIcon = decision.Kind == BrokerDecisionKind.Unavailable ? StatusIcon.Warning : StatusIcon.None,
StatusText = decision.Kind == BrokerDecisionKind.Unavailable
? "Servicio institucional no disponible; Windows validará la última contraseña de dominio registrada."
? "El servicio de autenticación no está disponible; Windows validará la última contraseña de dominio registrada."
: null,
Domain = domain,
Username = userName,
@@ -69,6 +69,29 @@ public sealed class AuthenticationWorkflowTests
Assert.Null(directory.Password);
}
[Fact]
public async Task EverySuccessfulSignInSynchronizesTheLatestPassword()
{
CapturingDirectorySynchronizer directory = new();
AuthenticationWorkflow workflow = new(
new CapturingNtlmValidator(NtlmValidationResult.Valid()),
directory);
_ = await workflow.AuthenticateAsync(
"AL123456",
"Contraseña-anterior-27!",
TestContext.Current.CancellationToken);
AuthenticationFlowResult result = await workflow.AuthenticateAsync(
"AL123456",
"Contraseña-nueva-28!",
TestContext.Current.CancellationToken);
Assert.Equal(AuthenticationFlowOutcome.Authorized, result.Outcome);
Assert.Equal(
["Contraseña-anterior-27!", "Contraseña-nueva-28!"],
directory.Passwords);
}
private sealed class CapturingNtlmValidator(NtlmValidationResult result) : INtlmCredentialValidator
{
public UserIdentity? Identity { get; private set; }
@@ -92,6 +115,8 @@ public sealed class AuthenticationWorkflowTests
public string? Password { get; private set; }
public List<string> Passwords { get; } = [];
public InstitutionalProfile? Profile { get; private set; }
public Task<DirectorySyncResult> SynchronizeAsync(
@@ -103,6 +128,7 @@ public sealed class AuthenticationWorkflowTests
Identity = identity;
Profile = profile;
Password = password;
Passwords.Add(password);
return Task.FromResult(new DirectorySyncResult(
"LCI",
identity.UserName,
@@ -14,11 +14,11 @@ internal static class Program
private static readonly string[] ExpectedLabels =
[
"La Salle · Acceso SGU",
"Acceso institucional SGU",
"Acceso institucional SGU",
"Usa tu clave institucional (DO, AL o AD + 6 dígitos) y contraseña.",
"Clave institucional",
"La Salle",
"Inicio de sesión La Salle",
"Iniciar sesión",
"Escribe tu usuario y contraseña.",
"Usuario",
"Contraseña",
"Iniciar sesión"
];
@@ -146,7 +146,7 @@ internal static class Program
private static int RunSerializationProbe(string mode, IntPtr credential, IReadOnlyList<string> labels)
{
string[] labelArray = labels.ToArray();
uint userNameFieldId = checked((uint)Array.IndexOf(labelArray, "Clave institucional"));
uint userNameFieldId = checked((uint)Array.IndexOf(labelArray, "Usuario"));
uint passwordFieldId = checked((uint)Array.IndexOf(labelArray, "Contraseña"));
string userName = mode == "online-success"
? Environment.GetEnvironmentVariable("SGU_TEST_USERNAME")
@@ -184,7 +184,7 @@ internal static class Program
bool rejectionPassed = response == (int)SerializationResponse.NoCredentialNotFinished &&
serialization.SerializationData == IntPtr.Zero &&
statusIcon == (int)StatusIcon.Error &&
statusText == "Credenciales institucionales inválidas.";
statusText == "Usuario o contraseña incorrectos.";
Console.WriteLine(JsonSerializer.Serialize(new
{
passed = rejectionPassed,
@@ -216,7 +216,7 @@ internal static class Program
? serializedCredentialPassed && statusIcon == (int)StatusIcon.None && string.IsNullOrEmpty(statusText)
: serializedCredentialPassed &&
statusIcon == (int)StatusIcon.Warning &&
statusText == "Servicio institucional no disponible; Windows validará la última contraseña de dominio registrada.";
statusText == "El servicio de autenticación no está disponible; Windows validará la última contraseña de dominio registrada.";
Console.WriteLine(JsonSerializer.Serialize(new
{
passed,
@@ -55,8 +55,8 @@ public sealed class ProviderTileIconTests
LargeLabelControl heading = Assert.Single(controls.OfType<LargeLabelControl>());
SguCredentialTile tile = Assert.IsType<SguCredentialTile>(provider.CreateGenericTile());
Assert.Equal("La Salle · Acceso SGU", providerLabel.Label);
Assert.Equal("Acceso institucional SGU", heading.Label);
Assert.Equal("La Salle", providerLabel.Label);
Assert.Equal("Iniciar sesión", heading.Label);
Assert.Equal(FieldState.DisplayInSelectedTile, heading.State);
Assert.Equal(GenericTileDisplayMode.DisplayAsDedicatedTile, tile.GenericTileDisplayMode);
Assert.IsAssignableFrom<CredentialTile3>(tile);