RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Classe

Definizione

Implementazione predefinita per IRemoteAuthenticationService<TRemoteAuthenticationState> che usa l'interoperabilità JS per autenticare l'utente.

generic <typename TRemoteAuthenticationState, typename TAccount, typename TProviderOptions>
 where TRemoteAuthenticationState : RemoteAuthenticationState where TAccount : RemoteUserAccount where TProviderOptions : gcnew()public ref class RemoteAuthenticationService : Microsoft::AspNetCore::Components::Authorization::AuthenticationStateProvider, Microsoft::AspNetCore::Components::WebAssembly::Authentication::IAccessTokenProvider, Microsoft::AspNetCore::Components::WebAssembly::Authentication::IRemoteAuthenticationService<TRemoteAuthenticationState>
public class RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> : Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider, Microsoft.AspNetCore.Components.WebAssembly.Authentication.IAccessTokenProvider, Microsoft.AspNetCore.Components.WebAssembly.Authentication.IRemoteAuthenticationService<TRemoteAuthenticationState> where TRemoteAuthenticationState : RemoteAuthenticationState where TAccount : RemoteUserAccount where TProviderOptions : new()
type RemoteAuthenticationService<'RemoteAuthenticationState, 'Account, 'ProviderOptions (requires 'RemoteAuthenticationState :> RemoteAuthenticationState and 'Account :> RemoteUserAccount and 'ProviderOptions : (new : unit -> 'ProviderOptions))> = class
    inherit AuthenticationStateProvider
    interface IRemoteAuthenticationService<'RemoteAuthenticationState (requires 'RemoteAuthenticationState :> RemoteAuthenticationState)>
    interface IAccessTokenProvider
Public Class RemoteAuthenticationService(Of TRemoteAuthenticationState, TAccount, TProviderOptions)
Inherits AuthenticationStateProvider
Implements IAccessTokenProvider, IRemoteAuthenticationService(Of TRemoteAuthenticationState)

Parametri di tipo

TRemoteAuthenticationState

Stato da mantenere tra le operazioni di autenticazione.

TAccount

Tipo di RemoteUserAccount.

TProviderOptions

Le opzioni da passare alla libreria JavaScript sottostante che gestisce le operazioni di autenticazione.

Ereditarietà
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implementazioni

Costruttori

RemoteAuthenticationService<TRemoteAuthenticationState,TAccount, TProviderOptions>(IJSRuntime, IOptions<RemoteAuthenticationOptions<TProviderOptions>>, NavigationManager, AccountClaimsPrincipalFactory<TAccount>)

Inizializza una nuova istanza.

RemoteAuthenticationService<TRemoteAuthenticationState,TAccount, TProviderOptions>(IJSRuntime, IOptionsSnapshot<RemoteAuthenticationOptions<TProviderOptions>>, NavigationManager, AccountClaimsPrincipalFactory<TAccount>)
Obsoleti.

Inizializza una nuova istanza.

RemoteAuthenticationService<TRemoteAuthenticationState,TAccount, TProviderOptions>(IJSRuntime, IOptionsSnapshot<RemoteAuthenticationOptions<TProviderOptions>>, NavigationManager, AccountClaimsPrincipalFactory<TAccount>, ILogger<RemoteAuthenticationService<TRemoteAuthenticationState, TAccount,TProviderOptions>>)

Inizializza una nuova istanza.

Proprietà

AccountClaimsPrincipalFactory

Ottiene l'oggetto per eseguire il AccountClaimsPrincipalFactory<TAccount> mapping degli account a ClaimsPrincipal.

JsRuntime

Ottiene l'oggetto IJSRuntime da usare per eseguire operazioni di interoperabilità JavaScript.

Navigation

Ottiene l'oggetto NavigationManager usato per calcolare gli URL assoluti.

Options

Ottiene le opzioni per la libreria JavaScript sottostante che gestisce le operazioni di autenticazione.

Metodi

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Completa l'operazione di accesso per un utente quando viene eseguita all'esterno dell'origine dell'applicazione tramite un'operazione di reindirizzamento seguita da un callback di reindirizzamento a una pagina nell'applicazione.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Completa l'operazione di disconnessione per un utente quando viene eseguita all'esterno dell'origine dell'applicazione tramite un'operazione di reindirizzamento seguita da un callback di reindirizzamento a una pagina nell'applicazione.

GetAuthenticatedUser()

Ottiene l'autenticazione corrente usata usando l'interoperabilità JavaScript.

GetAuthenticationStateAsync()

Ottiene in modo asincrono un oggetto AuthenticationState che descrive l'utente corrente.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Genera l'evento AuthenticationStateChanged.

(Ereditato da AuthenticationStateProvider)
RequestAccessToken()

Tenta di ottenere un token di accesso per l'utente corrente con il set predefinito di autorizzazioni.

RequestAccessToken(AccessTokenRequestOptions)

Prova a ottenere un token di accesso con le opzioni specificate in AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Accedere a un utente.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Disconnette un utente.

Eventi

AuthenticationStateChanged

Evento che fornisce una notifica quando l'oggetto AuthenticationState è cambiato. Ad esempio, questo evento può essere generato se un utente accede o esce.

(Ereditato da AuthenticationStateProvider)

Si applica a