AuthenticationServiceCollectionExtensions.AddAuthentication 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddAuthentication(IServiceCollection) |
註冊驗證服務所需的服務。 |
AddAuthentication(IServiceCollection, Action<AuthenticationOptions>) |
註冊驗證服務所需的服務,並設定 AuthenticationOptions 。 |
AddAuthentication(IServiceCollection, Action<SharedAuthenticationOptions>) | |
AddAuthentication(IServiceCollection, String) |
註冊驗證服務所需的服務。
|
AddAuthentication(IServiceCollection)
註冊驗證服務所需的服務。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection) As IServiceCollection
<Extension()>
Public Function AddAuthentication (services As IServiceCollection) As AuthenticationBuilder
參數
- services
- IServiceCollection
傳回
, AuthenticationBuilder 可用來進一步設定驗證。
適用於
AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)
註冊驗證服務所需的服務,並設定 AuthenticationOptions 。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Authentication.AuthenticationOptions> configureOptions);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Authentication.AuthenticationOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, configureOptions As Action(Of AuthenticationOptions)) As AuthenticationBuilder
參數
- services
- IServiceCollection
- configureOptions
- Action<AuthenticationOptions>
要設定 AuthenticationOptions 的委派。
傳回
, AuthenticationBuilder 可用來進一步設定驗證。
適用於
AddAuthentication(IServiceCollection, Action<SharedAuthenticationOptions>)
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions> configureOptions);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, configureOptions As Action(Of SharedAuthenticationOptions)) As IServiceCollection
參數
- services
- IServiceCollection
- configureOptions
- Action<SharedAuthenticationOptions>
傳回
適用於
AddAuthentication(IServiceCollection, String)
註冊驗證服務所需的服務。
defaultScheme
指定未要求特定配置時,預設要使用的配置名稱。
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string defaultScheme);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, defaultScheme As String) As AuthenticationBuilder
參數
- services
- IServiceCollection
- defaultScheme
- String
作為所有其他配置後援的預設配置。
傳回
, AuthenticationBuilder 可用來進一步設定驗證。