Share via


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Klasse

Definition

Die Standardimplementierung für IRemoteAuthenticationService<TRemoteAuthenticationState> , die JS-Interop verwendet, um den Benutzer zu authentifizieren.

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)

Typparameter

TRemoteAuthenticationState

Der Zustand, der über Authentifizierungsvorgänge hinweg beibehalten werden soll.

TAccount

Der Typ des RemoteUserAccount.

TProviderOptions

Die Optionen, die an die zugrunde liegende JavaScript-Bibliothek übergeben werden sollen, die die Authentifizierungsvorgänge verarbeitet.

Vererbung
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implementiert

Konstruktoren

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

Initialisiert eine neue Instanz.

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

Initialisiert eine neue Instanz.

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

Initialisiert eine neue Instanz.

Eigenschaften

AccountClaimsPrincipalFactory

Ruft die AccountClaimsPrincipalFactory<TAccount> ab, um Konten zu ClaimsPrincipalzuordnen.

JsRuntime

Ruft die ab, die IJSRuntime zum Ausführen von JavaScript-Interopvorgängen verwendet werden soll.

Navigation

Ruft die ab, die NavigationManager zum Berechnen absoluter URLs verwendet wird.

Options

Ruft die Optionen für die zugrunde liegende JavaScript-Bibliothek ab, die die Authentifizierungsvorgänge behandelt.

Methoden

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Schließt den Anmeldevorgang für einen Benutzer ab, wenn er außerhalb des Anwendungsursprungs über einen Umleitungsvorgang gefolgt von einem Umleitungsrückruf auf eine Seite in der Anwendung ausgeführt wird.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Schließt den Abmeldevorgang für einen Benutzer ab, wenn er außerhalb des Anwendungsursprungs über einen Umleitungsvorgang gefolgt von einem Umleitungsrückruf auf eine Seite in der Anwendung ausgeführt wird.

GetAuthenticatedUser()

Ruft die aktuell authentifizierte ab, die mithilfe der JavaScript-Interop verwendet wird.

GetAuthenticationStateAsync()

Ruft asynchron einen AuthenticationState ab, der den aktuellen Benutzer beschreibt.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Löst das AuthenticationStateChanged-Ereignis aus.

(Geerbt von AuthenticationStateProvider)
RequestAccessToken()

Versucht, ein Zugriffstoken für den aktuellen Benutzer mit dem Standardberechtigungssatz abzurufen.

RequestAccessToken(AccessTokenRequestOptions)

Versucht, ein Zugriffstoken mit den in AccessTokenRequestOptionsangegebenen Optionen abzurufen.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Anmeldet einen Benutzer.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Meldet einen Benutzer ab.

Ereignisse

AuthenticationStateChanged

Ein Ereignis, das eine Benachrichtigung bereitstellt, wenn sich das AuthenticationState geändert hat. Dieses Ereignis kann z. B. ausgelöst werden, wenn sich ein Benutzer an- oder abmeldet.

(Geerbt von AuthenticationStateProvider)

Gilt für: