Delen via


SignInManager<TUser> Class

Definition

Provides the APIs for user sign in.

generic <typename TUser>
 where TUser : classpublic ref class SignInManager
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>

Constructors

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

Creates a new instance of SignInManager<TUser>.

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

Creates a new instance of SignInManager<TUser>.

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

Creates a new instance of SignInManager<TUser>.

Properties

AuthenticationScheme

The authentication scheme to sign in with. Defaults to ApplicationScheme.

ClaimsFactory

The IUserClaimsPrincipalFactory<TUser> used.

Context

The HttpContext used.

Logger

Gets the ILogger used to log messages from the manager.

Options

The IdentityOptions used.

UserManager

The UserManager<TUser> used.

Methods

CanSignInAsync(TUser)

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

CheckPasswordSignInAsync(TUser, String, Boolean)

Attempts a password sign in for a user.

ConfigureExternalAuthenticationProperties(String, String, String)

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

CreateUserPrincipalAsync(TUser)

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

ExternalLoginSignInAsync(String, String, Boolean, Boolean)

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

ExternalLoginSignInAsync(String, String, Boolean)

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

ForgetTwoFactorClientAsync()

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

GetExternalAuthenticationSchemes()

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

GetExternalAuthenticationSchemesAsync()

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

GetExternalLoginInfoAsync(String)

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

GetTwoFactorAuthenticationUserAsync()

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

IsLockedOut(TUser)

Used to determine if a user is considered locked out.

IsSignedIn(ClaimsPrincipal)

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

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.

IsTwoFactorEnabledAsync(TUser)

Check if the user has two factor enabled.

LockedOut(TUser)

Returns a locked out SignInResult.

PasswordSignInAsync(String, String, Boolean, Boolean)

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

PasswordSignInAsync(TUser, String, Boolean, Boolean)

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

PreSignInCheck(TUser)

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

RefreshSignInAsync(TUser)

Signs in the specified user, whilst preserving the existing AuthenticationProperties of the current signed-in user like rememberMe, as an asynchronous operation.

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)

Used to reset a user's lockout count.

SignInAsync(TUser, AuthenticationProperties, String)

Signs in the specified user.

SignInAsync(TUser, AuthenticationProperties, String)

Signs in the specified user.

SignInAsync(TUser, Boolean, String)

Signs in the specified user.

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.

SignInWithClaimsAsync(TUser, AuthenticationProperties, IEnumerable<Claim>)

Signs in the specified user.

SignInWithClaimsAsync(TUser, Boolean, IEnumerable<Claim>)

Signs in the specified user.

SignOutAsync()

Signs the current user out of the application.

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)

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

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)

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

ValidateSecurityStampAsync(ClaimsPrincipal)

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

ValidateSecurityStampAsync(TUser, String)

Validates the security stamp for the specified user. If no user is specified, or if the store does not support security stamps, validation is considered successful.

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