Add SGU credential provider and authentication broker
This commit is contained in:
1 parent
5e216f42a4
commit
1f43f200b4
50 files changed
+3226
-236
No files matched your search
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Lithnet.CredentialProvider;
|
||||
|
||||
namespace SGU.CredentialProvider;
|
||||
|
||||
[ComVisible(true)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ProgId("SGU.CredentialProvider")]
|
||||
[Guid(ProviderClassId)]
|
||||
public sealed class SguCredentialProvider : CredentialProviderBase
|
||||
{
|
||||
public const string ProviderClassId = "D789CFD8-5AD4-489F-9B83-7EB5D9D09335";
|
||||
|
||||
public override IEnumerable<ControlBase> GetControls(UsageScenario cpus)
|
||||
{
|
||||
yield return new CredentialProviderLabelControl(ControlKeys.ProviderLabel, "Acceso institucional SGU");
|
||||
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");
|
||||
SecurePasswordTextboxControl password = new(ControlKeys.Password, "Contraseña");
|
||||
yield return password;
|
||||
yield return new SubmitButtonControl(ControlKeys.Submit, "Iniciar sesión", password);
|
||||
}
|
||||
|
||||
public override bool IsUsageScenarioSupported(UsageScenario cpus, CredUIWinFlags dwFlags) =>
|
||||
cpus is UsageScenario.Logon or UsageScenario.UnlockWorkstation or UsageScenario.CredUI;
|
||||
|
||||
public override bool ShouldIncludeUserTile(CredentialProviderUser user) => false;
|
||||
|
||||
public override bool ShouldIncludeGenericTile() => true;
|
||||
|
||||
public override CredentialTile CreateGenericTile() => new SguCredentialTile(this);
|
||||
|
||||
public override CredentialTile2 CreateUserTile(CredentialProviderUser user) =>
|
||||
new SguCredentialTile(this, user);
|
||||
}
|
||||
Reference in new issue
Block a user