RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Klasa
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Domyślna implementacja używa IRemoteAuthenticationService<TRemoteAuthenticationState> międzyoperajności JS do uwierzytelniania użytkownika.
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
Stan do zachowania w ramach operacji uwierzytelniania.
- TAccount
Typ elementu RemoteUserAccount.
- TProviderOptions
Opcje, które mają być przekazywane do podstawowej biblioteki JavaScript obsługującej operacje uwierzytelniania.
- Dziedziczenie
-
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
- Implementuje
Konstruktory
Właściwości
AccountClaimsPrincipalFactory |
Pobiera element AccountClaimsPrincipalFactory<TAccount> do mapowania kont na ClaimsPrincipal. |
JsRuntime |
Pobiera element IJSRuntime używany do wykonywania operacji międzyoperacyjności języka JavaScript. |
Navigation |
Pobiera wartość NavigationManager używaną do obliczania bezwzględnych adresów URL. |
Options |
Pobiera opcje podstawowej biblioteki JavaScript obsługującej operacje uwierzytelniania. |
Metody
CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>) |
Kończy operację logowania użytkownika, gdy jest on wykonywany poza źródłem aplikacji za pośrednictwem operacji przekierowania, po której następuje wywołanie zwrotne przekierowania do strony w aplikacji. |
CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>) |
Kończy operację wylogowania użytkownika, gdy jest wykonywana poza źródłem aplikacji za pośrednictwem operacji przekierowania, po której następuje wywołanie zwrotne przekierowania do strony w aplikacji. |
GetAuthenticatedUser() |
Pobiera bieżący uwierzytelniony używany przy użyciu międzyoperacyjności języka JavaScript. |
GetAuthenticationStateAsync() |
Asynchronicznie pobiera element AuthenticationState opisujący bieżącego użytkownika. |
NotifyAuthenticationStateChanged(Task<AuthenticationState>) |
AuthenticationStateChanged Zgłasza zdarzenie. (Odziedziczone po AuthenticationStateProvider) |
RequestAccessToken() |
Próbuje uzyskać token dostępu dla bieżącego użytkownika z domyślnym zestawem uprawnień. |
RequestAccessToken(AccessTokenRequestOptions) |
Próbuje uzyskać token dostępu z opcjami określonymi w AccessTokenRequestOptionspliku . |
SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>) |
Loguje się do użytkownika. |
SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>) |
Wy wylogowanie użytkownika. |
Zdarzenia
AuthenticationStateChanged |
Zdarzenie, które dostarcza powiadomienie po AuthenticationState zmianie. Na przykład to zdarzenie może zostać zgłoszone, jeśli użytkownik zaloguje się lub wyloguje. (Odziedziczone po AuthenticationStateProvider) |