View Source
Class UmbracoSignInManager<TUser>
Abstract sign in manager implementation allowing modifying all default authentication schemes.
Inheritance
object
SignInManager<TUser>
Assembly: Umbraco.Web.Common.dll
Syntax
public abstract class UmbracoSignInManager<TUser> : SignInManager<TUser> where TUser : UmbracoIdentityUser
Type Parameters
Constructors
View Source
UmbracoSignInManager(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>, IAuthenticationSchemeProvider, IUserConfirmation<TUser>, IOptions<SecuritySettings>, IRequestCache)
Declaration
public UmbracoSignInManager(UserManager<TUser> userManager, IHttpContextAccessor contextAccessor, IUserClaimsPrincipalFactory<TUser> claimsFactory, IOptions<IdentityOptions> optionsAccessor, ILogger<SignInManager<TUser>> logger, IAuthenticationSchemeProvider schemes, IUserConfirmation<TUser> confirmation, IOptions<SecuritySettings> securitySettingsOptions, IRequestCache requestCache)
Parameters
| Type |
Name |
Description |
| UserManager<TUser> |
userManager |
|
| IHttpContextAccessor |
contextAccessor |
|
| IUserClaimsPrincipalFactory<TUser> |
claimsFactory |
|
| IOptions<IdentityOptions> |
optionsAccessor |
|
| ILogger<SignInManager<TUser>> |
logger |
|
| IAuthenticationSchemeProvider |
schemes |
|
| IUserConfirmation<TUser> |
confirmation |
|
| IOptions<SecuritySettings> |
securitySettingsOptions |
|
| IRequestCache |
requestCache |
|
Fields
View Source
UmbracoSignInMgrLoginProviderKey
Declaration
protected const string UmbracoSignInMgrLoginProviderKey = "LoginProvider"
Field Value
View Source
UmbracoSignInMgrXsrfKey
Declaration
protected const string UmbracoSignInMgrXsrfKey = "XsrfId"
Field Value
Properties
View Source
AllowConcurrentLoginsEnabled
Declaration
protected virtual bool AllowConcurrentLoginsEnabled { get; }
Property Value
View Source
AuthenticationType
Declaration
protected abstract string AuthenticationType { get; }
Property Value
View Source
ExternalAuthenticationType
Declaration
protected abstract string ExternalAuthenticationType { get; }
Property Value
View Source
SecuritySettings
Declaration
protected SecuritySettings SecuritySettings { get; }
Property Value
View Source
TwoFactorAuthenticationType
Declaration
protected abstract string TwoFactorAuthenticationType { get; }
Property Value
View Source
TwoFactorRememberMeAuthenticationType
Declaration
protected abstract string TwoFactorRememberMeAuthenticationType { get; }
Property Value
Methods
View Source
CreateUserPrincipalAsync(Guid)
Declaration
public virtual Task<ClaimsPrincipal?> CreateUserPrincipalAsync(Guid userKey)
Parameters
| Type |
Name |
Description |
| Guid |
userKey |
|
Returns
| Type |
Description |
| Task<ClaimsPrincipal> |
|
View Source
ForgetTwoFactorClientAsync()
Declaration
public override Task ForgetTwoFactorClientAsync()
Returns
View Source
GetExternalLoginInfoAsync(string?)
Declaration
public override Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
Parameters
| Type |
Name |
Description |
| string |
expectedXsrf |
|
Returns
| Type |
Description |
| Task<ExternalLoginInfo> |
|
View Source
GetTwoFactorAuthenticationUserAsync()
Declaration
public override Task<TUser?> GetTwoFactorAuthenticationUserAsync()
Returns
| Type |
Description |
| Task<TUser> |
|
View Source
HandleSignIn(TUser?, string?, SignInResult)
Called on any login attempt to update the AccessFailedCount and to raise events
Declaration
protected virtual Task<SignInResult> HandleSignIn(TUser? user, string? username, SignInResult result)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
| string |
username |
|
| SignInResult |
result |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|
View Source
IsSignedIn(ClaimsPrincipal)
Declaration
public override bool IsSignedIn(ClaimsPrincipal principal)
Parameters
| Type |
Name |
Description |
| ClaimsPrincipal |
principal |
|
Returns
View Source
IsTwoFactorClientRememberedAsync(TUser)
Declaration
public override Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
Returns
| Type |
Description |
| Task<bool> |
|
View Source
PasswordSignInAsync(string, string, bool, bool)
Declaration
public override Task<SignInResult> PasswordSignInAsync(string userName, string password, bool isPersistent, bool lockoutOnFailure)
Parameters
| Type |
Name |
Description |
| string |
userName |
|
| string |
password |
|
| bool |
isPersistent |
|
| bool |
lockoutOnFailure |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|
View Source
PasswordSignInAsync(TUser, string, bool, bool)
Declaration
public override Task<SignInResult> PasswordSignInAsync(TUser user, string password, bool isPersistent, bool lockoutOnFailure)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
| string |
password |
|
| bool |
isPersistent |
|
| bool |
lockoutOnFailure |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|
View Source
RefreshSignInAsync(TUser)
Declaration
public override Task RefreshSignInAsync(TUser user)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
Returns
View Source
RememberTwoFactorClientAsync(TUser)
Declaration
public override Task RememberTwoFactorClientAsync(TUser user)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
Returns
View Source
SignInOrTwoFactorAsync(TUser, bool, string?, bool)
Declaration
protected override Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
| bool |
isPersistent |
|
| string |
loginProvider |
|
| bool |
bypassTwoFactor |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|
View Source
SignInWithClaimsAsync(TUser, AuthenticationProperties?, IEnumerable<Claim>)
Declaration
public override Task SignInWithClaimsAsync(TUser user, AuthenticationProperties? authenticationProperties, IEnumerable<Claim> additionalClaims)
Parameters
| Type |
Name |
Description |
| TUser |
user |
|
| AuthenticationProperties |
authenticationProperties |
|
| IEnumerable<Claim> |
additionalClaims |
|
Returns
View Source
SignOutAsync()
Declaration
public override Task SignOutAsync()
Returns
View Source
TwoFactorRecoveryCodeSignInAsync(string)
Declaration
public override Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
Parameters
| Type |
Name |
Description |
| string |
recoveryCode |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|
View Source
TwoFactorSignInAsync(string, string, bool, bool)
Declaration
public override Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
Parameters
| Type |
Name |
Description |
| string |
provider |
|
| string |
code |
|
| bool |
isPersistent |
|
| bool |
rememberClient |
|
Returns
| Type |
Description |
| Task<SignInResult> |
|