BlazorAuthenticationChallengeHandler Class

Definition

Handles authentication challenges for Blazor Server components. Provides functionality for incremental consent and Conditional Access scenarios.

public class BlazorAuthenticationChallengeHandler
type BlazorAuthenticationChallengeHandler = class
Public Class BlazorAuthenticationChallengeHandler
Inheritance
BlazorAuthenticationChallengeHandler

Remarks

This handler is designed specifically for Blazor Server scenarios where authentication challenges need to be initiated from component code. It supports incremental consent (requesting additional scopes) and Conditional Access (handling step-up authentication). Use this in combination with MapLoginAndLogout(IEndpointRouteBuilder) to enable seamless authentication flows in Blazor Server applications.

Constructors

Name Description
BlazorAuthenticationChallengeHandler(NavigationManager, AuthenticationStateProvider, IConfiguration)

Handles authentication challenges for Blazor Server components. Provides functionality for incremental consent and Conditional Access scenarios.

Methods

Name Description
ChallengeUser(ClaimsPrincipal, String[], String)

Initiates a challenge to authenticate the user or request additional consent.

ChallengeUserWithConfiguredScopesAsync(String)

Initiates a challenge with scopes from configuration.

GetUserAsync()

Gets the current user's authentication state.

HandleExceptionAsync(Exception)

Handles exceptions that may require user re-authentication. Returns true if a challenge was initiated, false otherwise.

IsAuthenticatedAsync()

Checks if the current user is authenticated.

Applies to