SignInManager<TUser> SignInManager<TUser> SignInManager<TUser> Class

Definition

Provides the APIs for user sign in.

public class SignInManager<TUser> where TUser : class
type SignInManager<'User (requires 'User : null)> = class
Public Class SignInManager(Of TUser)

Type Parameters

TUser

The type encapsulating a user.

Inheritance
SignInManager<TUser>SignInManager<TUser>SignInManager<TUser>

Constructors

SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>) SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>) SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>)

Creates a new instance of SignInManager<TUser>.

SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>, IAuthenticationSchemeProvider) SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>, IAuthenticationSchemeProvider) SignInManager<TUser>(UserManager<TUser>, IHttpContextAccessor, IUserClaimsPrincipalFactory<TUser>, IOptions<IdentityOptions>, ILogger<SignInManager<TUser>>, IAuthenticationSchemeProvider)

Creates a new instance of SignInManager<TUser>.

Properties

ClaimsFactory ClaimsFactory ClaimsFactory

The IUserClaimsPrincipalFactory<TUser> used.

Context Context Context

The HttpContext used.

Logger Logger Logger

Gets the ILogger used to log messages from the manager.

Options Options Options

The IdentityOptions used.

UserManager UserManager UserManager

The UserManager<TUser> used.

Methods

CanSignInAsync(TUser) CanSignInAsync(TUser) CanSignInAsync(TUser)

Returns a flag indicating whether the specified user can sign in.

CheckPasswordSignInAsync(TUser, String, Boolean) CheckPasswordSignInAsync(TUser, String, Boolean) CheckPasswordSignInAsync(TUser, String, Boolean)

Attempts a password sign in for a user.

ConfigureExternalAuthenticationProperties(String, String, String) ConfigureExternalAuthenticationProperties(String, String, String) ConfigureExternalAuthenticationProperties(String, String, String)

Configures the redirect URL and user identifier for the specified external login provider.

CreateUserPrincipalAsync(TUser) CreateUserPrincipalAsync(TUser) CreateUserPrincipalAsync(TUser)

Creates a ClaimsPrincipal for the specified user, as an asynchronous operation.

ExternalLoginSignInAsync(String, String, Boolean, Boolean) ExternalLoginSignInAsync(String, String, Boolean, Boolean) ExternalLoginSignInAsync(String, String, Boolean, Boolean)

Signs in a user via a previously registered third party login, as an asynchronous operation.

ExternalLoginSignInAsync(String, String, Boolean) ExternalLoginSignInAsync(String, String, Boolean) ExternalLoginSignInAsync(String, String, Boolean)

Signs in a user via a previously registered third party login, as an asynchronous operation.

ForgetTwoFactorClientAsync() ForgetTwoFactorClientAsync() ForgetTwoFactorClientAsync()

Clears the "Remember this browser flag" from the current browser, as an asynchronous operation.

GetExternalAuthenticationSchemes() GetExternalAuthenticationSchemes() GetExternalAuthenticationSchemes()

Gets a collection of AuthenticationDescriptions for the known external login providers.

GetExternalAuthenticationSchemesAsync() GetExternalAuthenticationSchemesAsync() GetExternalAuthenticationSchemesAsync()

Gets a collection of AuthenticationSchemes for the known external login providers.

GetExternalLoginInfoAsync(String) GetExternalLoginInfoAsync(String) GetExternalLoginInfoAsync(String)

Gets the external login information for the current login, as an asynchronous operation.

GetTwoFactorAuthenticationUserAsync() GetTwoFactorAuthenticationUserAsync() GetTwoFactorAuthenticationUserAsync()

Gets the TUser for the current two factor authentication login, as an asynchronous operation.

IsLockedOut(TUser) IsLockedOut(TUser) IsLockedOut(TUser)

Used to determine if a user is considered locked out.

IsSignedIn(ClaimsPrincipal) IsSignedIn(ClaimsPrincipal) IsSignedIn(ClaimsPrincipal)

Returns true if the principal has an identity with the application cookie identity

IsTwoFactorClientRememberedAsync(TUser) IsTwoFactorClientRememberedAsync(TUser) IsTwoFactorClientRememberedAsync(TUser)

Returns a flag indicating if the current client browser has been remembered by two factor authentication for the user attempting to login, as an asynchronous operation.

LockedOut(TUser) LockedOut(TUser) LockedOut(TUser)

Returns a locked out SignInResult.

PasswordSignInAsync(String, String, Boolean, Boolean) PasswordSignInAsync(String, String, Boolean, Boolean) PasswordSignInAsync(String, String, Boolean, Boolean)

Attempts to sign in the specified userName and password combination as an asynchronous operation.

PasswordSignInAsync(TUser, String, Boolean, Boolean) PasswordSignInAsync(TUser, String, Boolean, Boolean) PasswordSignInAsync(TUser, String, Boolean, Boolean)

Attempts to sign in the specified user and password combination as an asynchronous operation.

PreSignInCheck(TUser) PreSignInCheck(TUser) PreSignInCheck(TUser)

Used to ensure that a user is allowed to sign in.

RefreshSignInAsync(TUser) RefreshSignInAsync(TUser) RefreshSignInAsync(TUser)

Regenerates the user's application cookie, whilst preserving the existing AuthenticationProperties like rememberMe, as an asynchronous operation.

RememberTwoFactorClientAsync(TUser) RememberTwoFactorClientAsync(TUser) RememberTwoFactorClientAsync(TUser)

Sets a flag on the browser to indicate the user has selected "Remember this browser" for two factor authentication purposes, as an asynchronous operation.

ResetLockout(TUser) ResetLockout(TUser) ResetLockout(TUser)

Used to reset a user's lockout count.

SignInAsync(TUser, AuthenticationProperties, String) SignInAsync(TUser, AuthenticationProperties, String) SignInAsync(TUser, AuthenticationProperties, String)

Signs in the specified user.

SignInAsync(TUser, Boolean, String) SignInAsync(TUser, Boolean, String) SignInAsync(TUser, Boolean, String)

Signs in the specified user.

SignInAsync(TUser, AuthenticationProperties, String) SignInAsync(TUser, AuthenticationProperties, String) SignInAsync(TUser, AuthenticationProperties, String)

Signs in the specified user.

SignInOrTwoFactorAsync(TUser, Boolean, String, Boolean) SignInOrTwoFactorAsync(TUser, Boolean, String, Boolean) SignInOrTwoFactorAsync(TUser, Boolean, String, Boolean)

Signs in the specified user if bypassTwoFactor is set to false. Otherwise stores the user for use after a two factor check.

SignOutAsync() SignOutAsync() SignOutAsync()

Signs the current user out of the application.

TwoFactorAuthenticatorSignInAsync(String, Boolean, Boolean) TwoFactorAuthenticatorSignInAsync(String, Boolean, Boolean) TwoFactorAuthenticatorSignInAsync(String, Boolean, Boolean)

Validates the sign in code from an authenticator app and creates and signs in the user, as an asynchronous operation.

TwoFactorRecoveryCodeSignInAsync(String) TwoFactorRecoveryCodeSignInAsync(String) TwoFactorRecoveryCodeSignInAsync(String)

Signs in the user without two factor authentication using a two factor recovery code.

TwoFactorSignInAsync(String, String, Boolean, Boolean) TwoFactorSignInAsync(String, String, Boolean, Boolean) TwoFactorSignInAsync(String, String, Boolean, Boolean)

Validates the two factor sign in code and creates and signs in the user, as an asynchronous operation.

UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo) UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo) UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo)

Stores any authentication tokens found in the external authentication cookie into the associated user.

ValidateSecurityStampAsync(TUser, String) ValidateSecurityStampAsync(TUser, String) ValidateSecurityStampAsync(TUser, String)

Validates the security stamp for the specified user. Will always return false if the userManager does not support security stamps.

ValidateSecurityStampAsync(ClaimsPrincipal) ValidateSecurityStampAsync(ClaimsPrincipal) ValidateSecurityStampAsync(ClaimsPrincipal)

Validates the security stamp for the specified principal against the persisted stamp for the current user, as an asynchronous operation.

ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal) ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal) ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal)

Validates the security stamp for the specified principal from one of the two factor principals (remember client or user id) against the persisted stamp for the current user, as an asynchronous operation.

Applies to