Class AspNetSignInManager<TUser>
- Namespace
- Stratara.Identity.AspNetCore.Services
- Assembly
- Stratara.Identity.AspNetCore.dll
Channel-agnostic ASP.NET Core implementation of IStrataraSignInManager that wraps the ASP.NET Core
SignInManager<TUser> + UserManager<TUser> and translates every outcome into the unified
StrataraSignInResult. Failure messages are resolved via
IStringLocalizer<T> (anchored on IdentityResources), so the current
CurrentUICulture decides the language. English is the default
resource set; German overrides ship as IdentityResources.de.resx.
public sealed class AspNetSignInManager<TUser> : IStrataraSignInManager where TUser : class, new()
Type Parameters
TUserThe ASP.NET Core Identity user type.
- Inheritance
-
AspNetSignInManager<TUser>
- Implements
- Inherited Members
- Extension Methods
Constructors
AspNetSignInManager(SignInManager<TUser>, UserManager<TUser>, IStringLocalizer<IdentityResources>)
Channel-agnostic ASP.NET Core implementation of IStrataraSignInManager that wraps the ASP.NET Core
SignInManager<TUser> + UserManager<TUser> and translates every outcome into the unified
StrataraSignInResult. Failure messages are resolved via
IStringLocalizer<T> (anchored on IdentityResources), so the current
CurrentUICulture decides the language. English is the default
resource set; German overrides ship as IdentityResources.de.resx.
public AspNetSignInManager(SignInManager<TUser> signInManager, UserManager<TUser> userManager, IStringLocalizer<IdentityResources> localizer)
Parameters
signInManagerSignInManager<TUser>userManagerUserManager<TUser>localizerIStringLocalizer<IdentityResources>
Methods
PasswordSignInAsync(string, string, bool, bool, CancellationToken)
Performs a password sign-in.
public Task<StrataraSignInResult> PasswordSignInAsync(string email, string password, bool isPersistent, bool lockoutOnFailure, CancellationToken cancellationToken = default)
Parameters
emailstringUser email.
passwordstringUser password.
isPersistentboolWhether the resulting session should persist.
lockoutOnFailureboolWhether repeated failures should advance the lockout counter.
cancellationTokenCancellationTokenPropagated to the underlying identity stack and any HTTP / DB calls.
Returns
RefreshSignInAsync(AccessTokenInfo, CancellationToken)
Refreshes the current sign-in using the given AccessTokenInfo's refresh token.
public Task<bool> RefreshSignInAsync(AccessTokenInfo tokenInfo, CancellationToken cancellationToken = default)
Parameters
tokenInfoAccessTokenInfoThe current access-token info.
cancellationTokenCancellationTokenPropagated to the refresh HTTP call and any subsequent token-persist.
Returns
Remarks
Not supported on server-side Blazor. The authentication session is managed by the ASP.NET Core authentication middleware (cookie-based), so there is no token-refresh flow. Token-refresh applies to non-web hosts (mobile, desktop) that talk to the identity HTTP endpoints directly.
SignOutAsync(CancellationToken)
Signs the current user out and clears any persisted token state.
public Task SignOutAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenPropagated to the underlying identity stack and any HTTP / DB calls.
Returns
TwoFactorAuthenticatorSignInAsync(string, bool, bool, CancellationToken)
Completes a two-factor sign-in step using a TOTP code.
public Task<StrataraSignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient, CancellationToken cancellationToken = default)
Parameters
codestringTOTP authenticator code.
isPersistentboolWhether the resulting session should persist.
rememberClientboolWhether to remember this client to skip future two-factor prompts.
cancellationTokenCancellationTokenPropagated to the underlying identity stack and any HTTP / DB calls.
Returns
TwoFactorRecoveryCodeSignInAsync(string, CancellationToken)
Completes a two-factor sign-in step using a recovery code.
public Task<StrataraSignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode, CancellationToken cancellationToken = default)
Parameters
recoveryCodestringRecovery code from the user's printed list.
cancellationTokenCancellationTokenPropagated to the underlying identity stack and any HTTP / DB calls.