Interface IStrataraAuthenticationStateProvider
- Namespace
- Stratara.Identity.Core.Abstractions
- Assembly
- Stratara.Identity.Core.dll
Channel-agnostic authentication-state surface that brokers sign-in / sign-out and exposes the current
access-token information. Implemented per host (e.g. BlazorAuthenticationStateProvider for server-side
Blazor; consumer-supplied for non-web hosts) and delegated to the matching IStrataraSignInManager.
public interface IStrataraAuthenticationStateProvider
- Extension Methods
Methods
GetAccessTokenInfoAsync(CancellationToken)
Returns the currently issued AccessTokenInfo, refreshing the token transparently if needed.
Task<AccessTokenInfo?> GetAccessTokenInfoAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenPropagated to any token-refresh HTTP / DB call.
Returns
- Task<AccessTokenInfo>
The token info, or
nullif no valid token is available.
PasswordSignInAsync(string, string, bool, bool, CancellationToken)
Performs a password sign-in.
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 across browser/app restarts.
lockoutOnFailureboolWhether repeated failures should advance the lockout counter.
cancellationTokenCancellationTokenPropagated to the underlying sign-in manager.
Returns
SignOutAsync(CancellationToken)
Signs the current user out and clears any persisted token state.
Task SignOutAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenPropagated to the underlying sign-in manager.
Returns
TwoFactorAuthenticatorSignInAsync(string, bool, bool, CancellationToken)
Completes a two-factor sign-in step using a TOTP code.
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 sign-in manager.
Returns
TwoFactorRecoveryCodeSignInAsync(string, CancellationToken)
Completes a two-factor sign-in step using a single-use recovery code.
Task<StrataraSignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode, CancellationToken cancellationToken = default)
Parameters
recoveryCodestringRecovery code from the user's printed list.
cancellationTokenCancellationTokenPropagated to the underlying sign-in manager.