Add branded default provider and enforced enrollment
This commit is contained in:
@@ -4,6 +4,8 @@ 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";
|
||||
public const string Password = "Password";
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace SGU.CredentialProvider;
|
||||
internal static class ProviderTileIcon
|
||||
{
|
||||
public const int Size = 72;
|
||||
public const int UserTileSize = 128;
|
||||
|
||||
public static Bitmap Create()
|
||||
{
|
||||
@@ -30,4 +31,29 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,18 @@ public sealed class SguCredentialProvider : CredentialProviderBase
|
||||
|
||||
public override IEnumerable<ControlBase> GetControls(UsageScenario cpus)
|
||||
{
|
||||
yield return new CredentialProviderLabelControl(ControlKeys.ProviderLabel, "Acceso institucional SGU");
|
||||
yield return new CredentialProviderLabelControl(
|
||||
ControlKeys.ProviderLabel,
|
||||
"Universidad La Salle · Acceso SGU");
|
||||
yield return new CredentialProviderLogoControl(
|
||||
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 SmallLabelControl(
|
||||
ControlKeys.InformationLabel,
|
||||
"Usa tu clave institucional (DO, AL o AD + 6 dígitos) y contraseña.");
|
||||
|
||||
@@ -13,6 +13,7 @@ internal sealed class SguCredentialTile : CredentialTile2
|
||||
public SguCredentialTile(CredentialProviderBase credentialProvider)
|
||||
: base(credentialProvider)
|
||||
{
|
||||
GenericTileDisplayMode = GenericTileDisplayMode.DisplayAsDedicatedTile;
|
||||
}
|
||||
|
||||
public SguCredentialTile(CredentialProviderBase credentialProvider, CredentialProviderUser user)
|
||||
|
||||
Reference in New Issue
Block a user