Share via


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Classe

Definição

A implementação padrão para IRemoteAuthenticationService<TRemoteAuthenticationState> que usa a interoperabilidade JS para autenticar o usuário.

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)

Parâmetros de tipo

TRemoteAuthenticationState

O estado a ser preservado entre operações de autenticação.

TAccount

O tipo do RemoteUserAccount.

TProviderOptions

As opções a serem passadas para a biblioteca JavaScript subjacente que manipula as operações de autenticação.

Herança
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implementações

Construtores

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

Inicializa uma nova instância.

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

Inicializa uma nova instância.

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

Inicializa uma nova instância.

Propriedades

AccountClaimsPrincipalFactory

Obtém o AccountClaimsPrincipalFactory<TAccount> para mapear contas para ClaimsPrincipal.

JsRuntime

Obtém o IJSRuntime a ser usado para executar operações de interoperabilidade do JavaScript.

Navigation

Obtém o NavigationManager usado para calcular URLs absolutas.

Options

Obtém as opções para a biblioteca JavaScript subjacente que manipula as operações de autenticação.

Métodos

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Conclui a operação de entrada de um usuário quando ela é executada fora da origem do aplicativo por meio de uma operação de redirecionamento seguida por um retorno de chamada de redirecionamento para uma página no aplicativo.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Conclui a operação de saída de um usuário quando ela é executada fora da origem do aplicativo por meio de uma operação de redirecionamento seguida por um retorno de chamada de redirecionamento para uma página no aplicativo.

GetAuthenticatedUser()

Obtém o autenticado atual usado usando a interoperabilidade do JavaScript.

GetAuthenticationStateAsync()

Obtém de forma assíncrona um AuthenticationState que descreve o usuário atual.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Aciona o evento AuthenticationStateChanged.

(Herdado de AuthenticationStateProvider)
RequestAccessToken()

Tenta obter um token de acesso para o usuário atual com o conjunto padrão de permissões.

RequestAccessToken(AccessTokenRequestOptions)

Tenta obter um token de acesso com as opções especificadas em AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Entra em um usuário.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Desconscreve um usuário.

Eventos

AuthenticationStateChanged

Um evento que fornece notificação quando o AuthenticationState foi alterado. Por exemplo, esse evento poderá ser gerado se um usuário fizer logon ou sair.

(Herdado de AuthenticationStateProvider)

Aplica-se a