Bagikan melalui


RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Kelas

Definisi

Implementasi default untuk IRemoteAuthenticationService<TRemoteAuthenticationState> yang menggunakan interop JS untuk mengautentikasi pengguna.

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)

Jenis parameter

TRemoteAuthenticationState

Status untuk mempertahankan seluruh operasi autentikasi.

TAccount

Jenis RemoteUserAccount.

TProviderOptions

Opsi yang akan diteruskan ke pustaka JavaScript yang mendasar yang menangani operasi autentikasi.

Warisan
RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions>
Penerapan

Konstruktor

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

Menginisialisasi instans baru.

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

Menginisialisasi instans baru.

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

Menginisialisasi instans baru.

Properti

AccountClaimsPrincipalFactory

AccountClaimsPrincipalFactory<TAccount> Mendapatkan ke memetakan akun ke ClaimsPrincipal.

JsRuntime

Mendapatkan penggunaan IJSRuntime untuk melakukan operasi interop JavaScript.

Navigation

Mendapatkan yang NavigationManager digunakan untuk menghitung url absolut.

Options

Mendapatkan opsi untuk pustaka JavaScript yang mendasar yang menangani operasi autentikasi.

Metode

CompleteSignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Menyelesaikan operasi masuk untuk pengguna saat dilakukan di luar asal aplikasi melalui operasi pengalihan diikuti dengan pengalihan panggilan balik ke halaman dalam aplikasi.

CompleteSignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Menyelesaikan operasi keluar untuk pengguna saat dilakukan di luar asal aplikasi melalui operasi pengalihan diikuti oleh panggilan balik pengalihan ke halaman dalam aplikasi.

GetAuthenticatedUser()

Mendapatkan autentikasi saat ini yang digunakan menggunakan interop JavaScript.

GetAuthenticationStateAsync()

Secara asinkron mendapatkan AuthenticationState yang menjelaskan pengguna saat ini.

NotifyAuthenticationStateChanged(Task<AuthenticationState>)

Memunculkan kejadian AuthenticationStateChanged.

(Diperoleh dari AuthenticationStateProvider)
RequestAccessToken()

Mencoba mendapatkan token akses untuk pengguna saat ini dengan sekumpulan izin default.

RequestAccessToken(AccessTokenRequestOptions)

Mencoba mendapatkan token akses dengan opsi yang ditentukan di AccessTokenRequestOptions.

SignInAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Memasukkan pengguna.

SignOutAsync(RemoteAuthenticationContext<TRemoteAuthenticationState>)

Mengeluarkan pengguna.

Acara

AuthenticationStateChanged

Peristiwa yang menyediakan pemberitahuan ketika AuthenticationState telah berubah. Misalnya, peristiwa ini dapat dinaikkan jika pengguna masuk atau keluar.

(Diperoleh dari AuthenticationStateProvider)

Berlaku untuk