MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddMsalAuthentication(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>) |
使用 msal.js 將驗證新增至 Blazor 應用程式。 |
AddMsalAuthentication<TRemoteAuthenticationState,TAccount>(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>) |
使用 msal.js 將驗證新增至 Blazor 應用程式。 |
AddMsalAuthentication<TRemoteAuthenticationState>(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>) |
使用 msal.js 將驗證新增至 Blazor 應用程式。 |
AddMsalAuthentication(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>)
使用 msal.js 將驗證新增至 Blazor 應用程式。
public static Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState,Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount> AddMsalAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> configure);
static member AddMsalAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount>
<Extension()>
Public Function AddMsalAuthentication (services As IServiceCollection, configure As Action(Of RemoteAuthenticationOptions(Of MsalProviderOptions))) As IRemoteAuthenticationBuilder(Of RemoteAuthenticationState, RemoteUserAccount)
參數
- services
- IServiceCollection
- configure
- Action<RemoteAuthenticationOptions<MsalProviderOptions>>
設定 的 RemoteAuthenticationOptions<TRemoteAuthenticationProviderOptions> 回呼。
傳回
適用於
AddMsalAuthentication<TRemoteAuthenticationState,TAccount>(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>)
使用 msal.js 將驗證新增至 Blazor 應用程式。
public static Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<TRemoteAuthenticationState,TAccount> AddMsalAuthentication<TRemoteAuthenticationState,TAccount> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> configure) where TRemoteAuthenticationState : Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, new() where TAccount : Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount;
static member AddMsalAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<'RemoteAuthenticationState, 'Account (requires 'RemoteAuthenticationState :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState and 'RemoteAuthenticationState : (new : unit -> 'RemoteAuthenticationState) and 'Account :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount)> (requires 'RemoteAuthenticationState :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState and 'RemoteAuthenticationState : (new : unit -> 'RemoteAuthenticationState) and 'Account :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount)
<Extension()>
Public Function AddMsalAuthentication(Of TRemoteAuthenticationState As {RemoteAuthenticationStateNew}, TAccount As {RemoteAuthenticationStateNew}) (services As IServiceCollection, configure As Action(Of RemoteAuthenticationOptions(Of MsalProviderOptions))) As IRemoteAuthenticationBuilder(Of TRemoteAuthenticationState, TAccount)
類型參數
- TRemoteAuthenticationState
遠端驗證狀態的類型。
- TAccount
RemoteUserAccount 的類型。
參數
- services
- IServiceCollection
- configure
- Action<RemoteAuthenticationOptions<MsalProviderOptions>>
設定 的 RemoteAuthenticationOptions<TRemoteAuthenticationProviderOptions> 回呼。
傳回
適用於
AddMsalAuthentication<TRemoteAuthenticationState>(IServiceCollection, Action<RemoteAuthenticationOptions<MsalProviderOptions>>)
使用 msal.js 將驗證新增至 Blazor 應用程式。
public static Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<TRemoteAuthenticationState,Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount> AddMsalAuthentication<TRemoteAuthenticationState> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> configure) where TRemoteAuthenticationState : Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, new();
static member AddMsalAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions>> -> Microsoft.Extensions.DependencyInjection.IRemoteAuthenticationBuilder<'RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount (requires 'RemoteAuthenticationState :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState and 'RemoteAuthenticationState : (new : unit -> 'RemoteAuthenticationState))> (requires 'RemoteAuthenticationState :> Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState and 'RemoteAuthenticationState : (new : unit -> 'RemoteAuthenticationState))
<Extension()>
Public Function AddMsalAuthentication(Of TRemoteAuthenticationState As {RemoteAuthenticationStateNew}) (services As IServiceCollection, configure As Action(Of RemoteAuthenticationOptions(Of MsalProviderOptions))) As IRemoteAuthenticationBuilder(Of TRemoteAuthenticationState, RemoteUserAccount)
類型參數
- TRemoteAuthenticationState
遠端驗證狀態的類型。
參數
- services
- IServiceCollection
- configure
- Action<RemoteAuthenticationOptions<MsalProviderOptions>>
設定 的 RemoteAuthenticationOptions<TRemoteAuthenticationProviderOptions> 回呼。
傳回
IRemoteAuthenticationBuilder<TRemoteAuthenticationState,RemoteUserAccount>