Sdílet prostřednictvím


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Třída

Definice

Výchozí implementace pro IRemoteAuthenticationService<TRemoteAuthenticationState> , která k ověření uživatele používá interop JS.

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)

Parametry typu

TRemoteAuthenticationState

Stav, který se má zachovat v rámci operací ověřování.

TAccount

Typ .RemoteUserAccount

TProviderOptions

Možnosti, které se mají předat základní knihovně JavaScriptu, která zpracovává operace ověřování.

Dědičnost
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implementuje

Konstruktory

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

Inicializuje novou instanci.

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

Inicializuje novou instanci.

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

Inicializuje novou instanci.

Vlastnosti

AccountClaimsPrincipalFactory

AccountClaimsPrincipalFactory<TAccount> Získá mapování účtů na ClaimsPrincipal.

JsRuntime

IJSRuntime Získá k použití pro provádění operací zprostředkovatele zprostředkovatele javascriptu.

Navigation

NavigationManager Získá objekt použitý k výpočtu absolutních adres URL.

Options

Získá možnosti pro podkladovou knihovnu JavaScriptu, která zpracovává operace ověřování.

Metody

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Dokončí operaci přihlášení uživatele, když se provede mimo původ aplikace prostřednictvím operace přesměrování následované zpětným voláním přesměrování na stránku v aplikaci.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Dokončí operaci odhlášení pro uživatele, když se provede mimo původ aplikace prostřednictvím operace přesměrování následované zpětným voláním přesměrování na stránku v aplikaci.

GetAuthenticatedUser()

Získá aktuální ověřené použité pomocí zprostředkovatele JavaScriptu.

GetAuthenticationStateAsync()

Asynchronně získá objekt AuthenticationState , který popisuje aktuálního uživatele.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

AuthenticationStateChanged Vyvolá událost.

(Zděděno od AuthenticationStateProvider)
RequestAccessToken()

Pokusí se získat přístupový token pro aktuálního uživatele s výchozí sadou oprávnění.

RequestAccessToken(AccessTokenRequestOptions)

Pokusí se získat přístupový token s možnostmi zadanými v AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Přihlásí uživatele.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Odhlaste uživatele.

Událost

AuthenticationStateChanged

Událost, která poskytuje oznámení, když došlo ke AuthenticationState změně. Tato událost může být například vyvolána, pokud se uživatel přihlásí nebo odhlásí.

(Zděděno od AuthenticationStateProvider)

Platí pro