Share via


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Clase

Definición

La implementación predeterminada de IRemoteAuthenticationService<TRemoteAuthenticationState> que usa la interoperabilidad de JS para autenticar al usuario.

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

Estado que se va a conservar en las operaciones de autenticación.

TAccount

Tipo de la propiedad RemoteUserAccount.

TProviderOptions

Las opciones que se van a pasar a la biblioteca de JavaScript subyacente que controla las operaciones de autenticación.

Herencia
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Implementaciones

Constructores

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

Inicializa una nueva instancia.

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

Inicializa una nueva instancia.

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

Inicializa una nueva instancia.

Propiedades

AccountClaimsPrincipalFactory

Obtiene el AccountClaimsPrincipalFactory<TAccount> objeto para asignar cuentas a ClaimsPrincipal.

JsRuntime

Obtiene el IJSRuntime objeto que se va a usar para realizar operaciones de interoperabilidad de JavaScript.

Navigation

Obtiene el objeto NavigationManager que se usa para calcular direcciones URL absolutas.

Options

Obtiene las opciones de la biblioteca de JavaScript subyacente que controla las operaciones de autenticación.

Métodos

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Completa la operación de inicio de sesión de un usuario cuando se realiza fuera del origen de la aplicación a través de una operación de redireccionamiento seguida de una devolución de llamada de redireccionamiento a una página de la aplicación.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Completa la operación de cierre de sesión de un usuario cuando se realiza fuera del origen de la aplicación a través de una operación de redireccionamiento seguida de una devolución de llamada de redireccionamiento a una página de la aplicación.

GetAuthenticatedUser()

Obtiene la autenticación actual usada mediante la interoperabilidad de JavaScript.

GetAuthenticationStateAsync()

Obtiene de forma asincrónica un AuthenticationState objeto que describe al usuario actual.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Genera el evento AuthenticationStateChanged.

(Heredado de AuthenticationStateProvider)
RequestAccessToken()

Intenta obtener un token de acceso para el usuario actual con el conjunto predeterminado de permisos.

RequestAccessToken(AccessTokenRequestOptions)

Intenta obtener un token de acceso con las opciones especificadas en AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Inicia sesión en un usuario.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Cierra la sesión de un usuario.

Eventos

AuthenticationStateChanged

Evento que proporciona una notificación cuando AuthenticationState ha cambiado . Por ejemplo, este evento se puede generar si un usuario inicia sesión o cierra sesión.

(Heredado de AuthenticationStateProvider)

Se aplica a