RemoteAuthenticationService<TRemoteAuthenticationState,TAccount,TProviderOptions> Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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
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) |