Skip to main content
Table of Contents

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

cancellationToken CancellationToken

Propagated to any token-refresh HTTP / DB call.

Returns

Task<AccessTokenInfo>

The token info, or null if 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

email string

User email.

password string

User password.

isPersistent bool

Whether the resulting session should persist across browser/app restarts.

lockoutOnFailure bool

Whether repeated failures should advance the lockout counter.

cancellationToken CancellationToken

Propagated to the underlying sign-in manager.

Returns

Task<StrataraSignInResult>

SignOutAsync(CancellationToken)

Signs the current user out and clears any persisted token state.

Task SignOutAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Propagated to the underlying sign-in manager.

Returns

Task

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

code string

TOTP authenticator code.

isPersistent bool

Whether the resulting session should persist.

rememberClient bool

Whether to remember this client to skip future two-factor prompts.

cancellationToken CancellationToken

Propagated to the underlying sign-in manager.

Returns

Task<StrataraSignInResult>

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

recoveryCode string

Recovery code from the user's printed list.

cancellationToken CancellationToken

Propagated to the underlying sign-in manager.

Returns

Task<StrataraSignInResult>