diff --git a/docs/architecture.md b/docs/architecture.md index 57e2d6a..c38540b 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -67,7 +67,12 @@ Every synchronized user also receives `Universidad La Salle` in the AD The generic SGU 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 while retaining the built-in Microsoft -password provider. +password provider. It enumerates one `CPFT_TILE_IMAGE` and places the +`CPFT_LARGE_TEXT` heading immediately after it with `CPFS_DISPLAY_IN_BOTH`, +matching Microsoft's supported field ordering. LogonUI owns field typography: +on Windows 10 and 11, the account-name title used by **Other user** is shell UI, +not a style that a generic Credential Provider can request. Do not add a second +tile image or a synthetic Windows account to imitate that title. The managed hierarchy is rooted at `OU=Usuarios-SGU`: `Docentes`, `Alumnos`, and `Administrativos` are direct child OUs beneath it. diff --git a/src/SGU.CredentialProvider/ControlKeys.cs b/src/SGU.CredentialProvider/ControlKeys.cs index 7330f29..7faa33c 100644 --- a/src/SGU.CredentialProvider/ControlKeys.cs +++ b/src/SGU.CredentialProvider/ControlKeys.cs @@ -4,7 +4,6 @@ internal static class ControlKeys { public const string ProviderLabel = "ProviderLabel"; public const string ProviderLogo = "ProviderLogo"; - public const string UserTile = "UserTile"; public const string Heading = "Heading"; public const string InformationLabel = "InformationLabel"; public const string UserName = "UserName"; diff --git a/src/SGU.CredentialProvider/ProviderTileIcon.cs b/src/SGU.CredentialProvider/ProviderTileIcon.cs index edb2678..68cc1d0 100644 --- a/src/SGU.CredentialProvider/ProviderTileIcon.cs +++ b/src/SGU.CredentialProvider/ProviderTileIcon.cs @@ -7,7 +7,6 @@ namespace SGU.CredentialProvider; internal static class ProviderTileIcon { public const int Size = 72; - public const int UserTileSize = 128; public static Bitmap Create() { @@ -31,29 +30,4 @@ internal static class ProviderTileIcon return bitmap; } - - public static Bitmap CreateUserTile() - { - Bitmap bitmap = new(UserTileSize, UserTileSize, PixelFormat.Format32bppArgb); - using Graphics graphics = Graphics.FromImage(bitmap); - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.Clear(Color.FromArgb(0, 83, 155)); - - using Pen border = new(Color.FromArgb(190, 221, 241), 5f); - using Pen key = new(Color.White, 9f) - { - StartCap = LineCap.Round, - EndCap = LineCap.Round, - LineJoin = LineJoin.Round - }; - - graphics.DrawEllipse(border, 7, 7, 113, 113); - graphics.DrawEllipse(key, 25, 25, 43, 43); - graphics.DrawLine(key, 62, 62, 99, 99); - graphics.DrawLine(key, 82, 82, 95, 69); - graphics.DrawLine(key, 93, 93, 106, 80); - - return bitmap; - } } diff --git a/src/SGU.CredentialProvider/SguCredentialProvider.cs b/src/SGU.CredentialProvider/SguCredentialProvider.cs index 1c57608..e9fcb56 100644 --- a/src/SGU.CredentialProvider/SguCredentialProvider.cs +++ b/src/SGU.CredentialProvider/SguCredentialProvider.cs @@ -21,11 +21,10 @@ public sealed class SguCredentialProvider : CredentialProviderBase ControlKeys.ProviderLogo, "Acceso institucional SGU", ProviderTileIcon.Create()); - yield return new UserTileControl( - ControlKeys.UserTile, - "Universidad La Salle", - ProviderTileIcon.CreateUserTile()); - yield return new LargeLabelControl(ControlKeys.Heading, "Acceso institucional SGU"); + yield return new LargeLabelControl(ControlKeys.Heading, "Acceso institucional SGU") + { + State = FieldState.DisplayInBoth + }; yield return new SmallLabelControl( ControlKeys.InformationLabel, "Usa tu clave institucional (DO, AL o AD + 6 dígitos) y contraseña."); diff --git a/tests/SGU.CredentialProvider.SmokeProbe/Program.cs b/tests/SGU.CredentialProvider.SmokeProbe/Program.cs index 891a53b..05ce4bd 100644 --- a/tests/SGU.CredentialProvider.SmokeProbe/Program.cs +++ b/tests/SGU.CredentialProvider.SmokeProbe/Program.cs @@ -16,7 +16,6 @@ internal static class Program [ "Universidad La Salle · Acceso SGU", "Acceso institucional SGU", - "Universidad La Salle", "Acceso institucional SGU", "Usa tu clave institucional (DO, AL o AD + 6 dígitos) y contraseña.", "Clave institucional", @@ -92,7 +91,7 @@ internal static class Program credentialCount == 1 && credential != IntPtr.Zero && providerLogoPresent && - userTilePresent && + !userTilePresent && labels.SequenceEqual(ExpectedLabels, StringComparer.Ordinal); if (mode != "enumeration" && passed) diff --git a/tests/SGU.CredentialProvider.Tests/ProviderTileIconTests.cs b/tests/SGU.CredentialProvider.Tests/ProviderTileIconTests.cs index dd3318f..9239d0f 100644 --- a/tests/SGU.CredentialProvider.Tests/ProviderTileIconTests.cs +++ b/tests/SGU.CredentialProvider.Tests/ProviderTileIconTests.cs @@ -33,18 +33,18 @@ public sealed class ProviderTileIconTests } [Fact] - public void ProviderPublishesABrandedDedicatedUserTileAndHeading() + public void ProviderPublishesASingleBrandedImageAndLargeHeading() { SguCredentialProvider provider = new(); ControlBase[] controls = provider.GetControls(UsageScenario.Logon).ToArray(); - UserTileControl userTile = Assert.Single(controls.OfType()); + Assert.Empty(controls.OfType()); + Assert.Single(controls.OfType()); LargeLabelControl heading = Assert.Single(controls.OfType()); SguCredentialTile tile = Assert.IsType(provider.CreateGenericTile()); - Assert.Equal(ProviderTileIcon.UserTileSize, userTile.Bitmap.Width); - Assert.Equal(ProviderTileIcon.UserTileSize, userTile.Bitmap.Height); Assert.Equal("Acceso institucional SGU", heading.Label); + Assert.Equal(FieldState.DisplayInBoth, heading.State); Assert.Equal(GenericTileDisplayMode.DisplayAsDedicatedTile, tile.GenericTileDisplayMode); } }