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。