Share via


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Classe

Définition

Implémentation par défaut pour IRemoteAuthenticationService<TRemoteAuthenticationState> qui utilise L’interopérabilité JS pour authentifier l’utilisateur.

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)

Paramètres de type

TRemoteAuthenticationState

État à conserver entre les opérations d’authentification.

TAccount

Type de RemoteUserAccount.

TProviderOptions

Options à transmettre à la bibliothèque JavaScript sous-jacente qui gère les opérations d’authentification.

Héritage
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implémente

Constructeurs

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

Initialise une nouvelle instance.

RemoteAuthenticationService<TRemoteAuthenticationState,TAccount, TProviderOptions>(IJSRuntime, IOptionsSnapshot<RemoteAuthenticationOptions<TProviderOptions>>, NavigationManager, AccountClaimsPrincipalFactory<TAccount>)
Obsolète.

Initialise une nouvelle instance.

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

Initialise une nouvelle instance.

Propriétés

AccountClaimsPrincipalFactory

Obtient le pour mapper les AccountClaimsPrincipalFactory<TAccount> comptes à ClaimsPrincipal.

JsRuntime

Obtient le IJSRuntime à utiliser pour effectuer des opérations d’interopérabilité JavaScript.

Navigation

Obtient le NavigationManager utilisé pour calculer les URL absolues.

Options

Obtient les options de la bibliothèque JavaScript sous-jacente qui gère les opérations d’authentification.

Méthodes

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Termine l’opération de connexion d’un utilisateur lorsqu’elle est effectuée en dehors de l’origine de l’application via une opération de redirection suivie d’un rappel de redirection vers une page de l’application.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Termine l’opération de déconnexion pour un utilisateur lorsqu’elle est effectuée en dehors de l’origine de l’application via une opération de redirection suivie d’un rappel de redirection vers une page de l’application.

GetAuthenticatedUser()

Obtient l’authentification actuelle utilisée à l’aide de l’interopérabilité JavaScript.

GetAuthenticationStateAsync()

Obtient de façon asynchrone un AuthenticationState qui décrit l’utilisateur actuel.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Déclenche l’événement AuthenticationStateChanged.

(Hérité de AuthenticationStateProvider)
RequestAccessToken()

Tente d’obtenir un jeton d’accès pour l’utilisateur actuel avec le jeu d’autorisations par défaut.

RequestAccessToken(AccessTokenRequestOptions)

Tente d’obtenir un jeton d’accès avec les options spécifiées dans AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Connecte un utilisateur.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Déconnecte un utilisateur.

Événements

AuthenticationStateChanged

Événement qui fournit une notification lorsque le AuthenticationState a changé. Par exemple, cet événement peut être déclenché si un utilisateur se connecte ou se déconnecte.

(Hérité de AuthenticationStateProvider)

S’applique à