Table of Contents

Class AppPrincipalFromAuthenticationState

Namespace
Arc4u.Blazor
Assembly
Arc4u.OAuth2.Blazor.dll

Rebuilds the AppPrincipal from the authentication state serialized by the Blazor server, and sets it in the IApplicationContext.

[Export(typeof(IAppPrincipalAuthenticationStateProvider))]
[Shared]
public class AppPrincipalFromAuthenticationState : IAppPrincipalAuthenticationStateProvider
Inheritance
AppPrincipalFromAuthenticationState
Implements
Inherited Members

Constructors

AppPrincipalFromAuthenticationState(IClaimProfileFiller, IClaimAuthorizationFiller, IApplicationContext)

Initializes a new instance of the AppPrincipalFromAuthenticationState class.

public AppPrincipalFromAuthenticationState(IClaimProfileFiller claimsFiller, IClaimAuthorizationFiller authorizationFiller, IApplicationContext applicationContext)

Parameters

claimsFiller IClaimProfileFiller

The filler that builds the user profile from the claims.

authorizationFiller IClaimAuthorizationFiller

The filler that builds the authorization from the claims.

applicationContext IApplicationContext

The application context that receives the principal.

Properties

DefaultAuthenticationState

Gets an authentication state for an anonymous user: a principal with an empty identity and no operation.

public static AuthenticationState DefaultAuthenticationState { get; }

Property Value

AuthenticationState

Methods

DeserializeAuthenticationStateAsync(AuthenticationStateData?)

Builds the authentication state from the serialized data.

public Task<AuthenticationState> DeserializeAuthenticationStateAsync(AuthenticationStateData? authenticationStateData)

Parameters

authenticationStateData AuthenticationStateData

The claims received from the server, or null for an anonymous user.

Returns

Task<AuthenticationState>

The authentication state.