语言

AuthenticationBuilder 类

定义

用于配置身份验证

public ref class AuthenticationBuilder
public class AuthenticationBuilder
type AuthenticationBuilder = class
Public Class AuthenticationBuilder
继承
AuthenticationBuilder

构造函数

名称 说明
AuthenticationBuilder(IServiceCollection)

初始化新实例 。AuthenticationBuilder

属性

名称 说明
Services

正在配置的服务。

方法

名称 说明
AddPolicyScheme(String, String, Action<PolicySchemeOptions>)

添加可用于 PolicySchemeHandler 重定向到其他身份验证方案的基于身份验证处理程序。

AddRemoteScheme<TOptions,THandler>(String, String, Action<TOptions>)

添加一个 RemoteAuthenticationHandler<TOptions> 支持远程身份验证的基于 AuthenticationScheme 项,该身份验证可供使用 IAuthenticationService。

AddScheme<TOptions,THandler>(String, Action<TOptions>)

添加一个 AuthenticationScheme 可供 IAuthenticationService使用。

AddScheme<TOptions,THandler>(String, String, Action<TOptions>)

添加一个 AuthenticationScheme 可供 IAuthenticationService使用。

扩展方法

名称 说明
AddApplicationCookie(AuthenticationBuilder)

添加标识应用程序 Cookie。

AddAzureAD(AuthenticationBuilder, Action<AzureADOptions>)
已过时.

将Azure Active Directory身份验证添加到应用程序。

AddAzureAD(AuthenticationBuilder, String, String, String, String, Action<AzureADOptions>)
已过时.

将Azure Active Directory身份验证添加到应用程序。

AddAzureADB2C(AuthenticationBuilder, Action<AzureADB2COptions>)
已过时.

将Azure Active Directory B2C 身份验证添加到应用程序。

AddAzureADB2C(AuthenticationBuilder, String, String, String, String, Action<AzureADB2COptions>)
已过时.

将Azure Active Directory B2C 身份验证添加到应用程序。

AddAzureADB2CBearer(AuthenticationBuilder, Action<AzureADB2COptions>)
已过时.

将 JWT 持有者身份验证添加到Azure AD B2C 应用程序的应用。

AddAzureADB2CBearer(AuthenticationBuilder, String, String, Action<AzureADB2COptions>)
已过时.

将 JWT 持有者身份验证添加到Azure AD B2C 应用程序的应用。

AddAzureADBearer(AuthenticationBuilder, Action<AzureADOptions>)
已过时.

将 JWT 持有者身份验证添加到Azure Active Directory应用程序的应用。

AddAzureADBearer(AuthenticationBuilder, String, String, Action<AzureADOptions>)
已过时.

将 JWT 持有者身份验证添加到Azure Active Directory应用程序的应用。

AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>)

添加持有者令牌身份验证。 默认方案由 AuthenticationScheme.

持有者令牌可以通过调用 SignInAsync(HttpContext, String, ClaimsPrincipal)来获取。

AddBearerToken(AuthenticationBuilder, String, Action<BearerTokenOptions>)

添加持有者令牌身份验证。

持有者令牌可以通过调用 SignInAsync(HttpContext, String, ClaimsPrincipal)来获取。

AddBearerToken(AuthenticationBuilder, String)

添加持有者令牌身份验证。

持有者令牌可以通过调用 SignInAsync(HttpContext, String, ClaimsPrincipal)来获取。

AddBearerToken(AuthenticationBuilder)

添加持有者令牌身份验证。 默认方案由 AuthenticationScheme.

持有者令牌可以通过调用 SignInAsync(HttpContext, String, ClaimsPrincipal)来获取。

AddCertificate(AuthenticationBuilder, Action<CertificateAuthenticationOptions>)

添加证书身份验证。

证书身份验证使用验证客户端证书的身份验证处理程序,并引发解析证书的事件 ClaimsPrincipal。 请参阅 https://tools.ietf.org/html/rfc5246#section-7.4.4 详细了解证书身份验证。

AddCertificate(AuthenticationBuilder, String, Action<CertificateAuthenticationOptions>)

添加证书身份验证。

证书身份验证使用验证客户端证书的身份验证处理程序,并引发解析证书的事件 ClaimsPrincipal。 请参阅 https://tools.ietf.org/html/rfc5246#section-7.4.4 详细了解证书身份验证。

AddCertificate(AuthenticationBuilder, String)

添加证书身份验证。

证书身份验证使用验证客户端证书的身份验证处理程序,并引发解析证书的事件 ClaimsPrincipal。 请参阅 https://tools.ietf.org/html/rfc5246#section-7.4.4 详细了解证书身份验证。

AddCertificate(AuthenticationBuilder)

添加证书身份验证。

证书身份验证使用验证客户端证书的身份验证处理程序,并引发解析证书的事件 ClaimsPrincipal。 请参阅 https://tools.ietf.org/html/rfc5246#section-7.4.4 详细了解证书身份验证。

AddCertificateCache(AuthenticationBuilder, Action<CertificateValidationCacheOptions>)

添加证书身份验证。

证书身份验证使用验证客户端证书的身份验证处理程序,并引发解析证书的事件 ClaimsPrincipal。 请参阅 https://tools.ietf.org/html/rfc5246#section-7.4.4 详细了解证书身份验证。

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

将 Cookie 身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Cookie 身份验证使用客户端中保留的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

将 Cookie 身份验证添加到 AuthenticationBuilder 使用指定的方案。

Cookie 身份验证使用客户端中保留的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String, String, Action<CookieAuthenticationOptions>)

将 Cookie 身份验证添加到 AuthenticationBuilder 使用指定的方案。

Cookie 身份验证使用客户端中保留的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder, String)

将 Cookie 身份验证添加到 AuthenticationBuilder 使用指定的方案。

Cookie 身份验证使用客户端中保留的 HTTP Cookie 来执行身份验证。

AddCookie(AuthenticationBuilder)

将 Cookie 身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Cookie 身份验证使用客户端中保留的 HTTP Cookie 来执行身份验证。

AddExternalCookie(AuthenticationBuilder)

添加用于外部登录的标识 Cookie。

AddFacebook(AuthenticationBuilder, Action<FacebookOptions>)

将基于 Facebook OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Facebook 身份验证允许应用程序用户使用其 Facebook 帐户登录。

AddFacebook(AuthenticationBuilder, String, Action<FacebookOptions>)

将基于 Facebook OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Facebook 身份验证允许应用程序用户使用其 Facebook 帐户登录。

AddFacebook(AuthenticationBuilder, String, String, Action<FacebookOptions>)

将基于 Facebook OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Facebook 身份验证允许应用程序用户使用其 Facebook 帐户登录。

AddFacebook(AuthenticationBuilder)

将基于 Facebook OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Facebook 身份验证允许应用程序用户使用其 Facebook 帐户登录。

AddGoogle(AuthenticationBuilder, Action<GoogleOptions>)

将基于 Google OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Google 身份验证允许应用程序用户使用其 Google 帐户登录。

AddGoogle(AuthenticationBuilder, String, Action<GoogleOptions>)

将基于 Google OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Google 身份验证允许应用程序用户使用其 Google 帐户登录。

AddGoogle(AuthenticationBuilder, String, String, Action<GoogleOptions>)

将基于 Google OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Google 身份验证允许应用程序用户使用其 Google 帐户登录。

AddGoogle(AuthenticationBuilder)

将基于 Google OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Google 身份验证允许应用程序用户使用其 Google 帐户登录。

AddIdentityCookies(AuthenticationBuilder, Action<IdentityCookiesBuilder>)

添加登录管理器所需的 Cookie 身份验证。

AddIdentityCookies(AuthenticationBuilder)

添加 Cookie 身份验证。

AddIdentityServerJwt(AuthenticationBuilder)

为与授权服务器共存的 API 添加身份验证处理程序。

AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>)

使用默认方案 AuthenticationScheme启用 JWT 持有者身份验证。

JWT 持有者身份验证通过从 Authorization 请求标头提取和验证 JWT 令牌来执行身份验证。

AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>)

使用指定的方案启用 JWT 持有者身份验证。

JWT 持有者身份验证通过从 Authorization 请求标头提取和验证 JWT 令牌来执行身份验证。

AddJwtBearer(AuthenticationBuilder, String, String, Action<JwtBearerOptions>)

使用指定的方案启用 JWT 持有者身份验证。

JWT 持有者身份验证通过从 Authorization 请求标头提取和验证 JWT 令牌来执行身份验证。

AddJwtBearer(AuthenticationBuilder, String)

使用预定义的方案启用 JWT 持有者身份验证。

JWT 持有者身份验证通过从 Authorization 请求标头提取和验证 JWT 令牌来执行身份验证。

AddJwtBearer(AuthenticationBuilder)

使用默认方案 AuthenticationScheme启用 JWT 持有者身份验证。

JWT 持有者身份验证通过从 Authorization 请求标头提取和验证 JWT 令牌来执行身份验证。

AddMicrosoftAccount(AuthenticationBuilder, Action<MicrosoftAccountOptions>)

将基于帐户 OAuth 的身份验证添加到AuthenticationBuilder使用默认方案Microsoft。 默认方案由 AuthenticationScheme.

Microsoft Account身份验证允许应用程序用户使用其工作、学校或个人Microsoft 帐户登录。

AddMicrosoftAccount(AuthenticationBuilder, String, Action<MicrosoftAccountOptions>)

将基于帐户 OAuth 的身份验证添加到AuthenticationBuilder使用默认方案Microsoft。 默认方案由 AuthenticationScheme.

Microsoft Account身份验证允许应用程序用户使用其工作、学校或个人Microsoft 帐户登录。

AddMicrosoftAccount(AuthenticationBuilder, String, String, Action<MicrosoftAccountOptions>)

将基于帐户 OAuth 的身份验证添加到AuthenticationBuilder使用默认方案Microsoft。 默认方案由 AuthenticationScheme.

Microsoft Account身份验证允许应用程序用户使用其工作、学校或个人Microsoft 帐户登录。

AddMicrosoftAccount(AuthenticationBuilder)

将基于帐户 OAuth 的身份验证添加到AuthenticationBuilder使用默认方案Microsoft。 默认方案由 AuthenticationScheme.

Microsoft Account身份验证允许应用程序用户使用其工作、学校或个人Microsoft 帐户登录。

AddNegotiate(AuthenticationBuilder, Action<NegotiateOptions>)

AuthenticationBuilder使用默认方案配置使用 Negotiate(也称为 Windows、Kerberos 或 NTLM)身份验证。 默认方案由 AuthenticationScheme.

此身份验证处理程序支持 Windows 和 Linux 服务器上的 Kerberos。

AddNegotiate(AuthenticationBuilder, String, Action<NegotiateOptions>)

AuthenticationBuilder使用指定的身份验证方案配置要使用的 Negotiate(也称为 Windows、Kerberos 或 NTLM)身份验证。

此身份验证处理程序支持 Windows 和 Linux 服务器上的 Kerberos。

AddNegotiate(AuthenticationBuilder, String, String, Action<NegotiateOptions>)

AuthenticationBuilder使用指定的身份验证方案配置要使用的 Negotiate(也称为 Windows、Kerberos 或 NTLM)身份验证。

此身份验证处理程序支持 Windows 和 Linux 服务器上的 Kerberos。

AddNegotiate(AuthenticationBuilder)

AuthenticationBuilder使用默认方案AuthenticationScheme配置使用 Negotiate(也称为 Windows、Kerberos 或 NTLM)身份验证。

此身份验证处理程序支持 Windows 和 Linux 服务器上的 Kerberos。

AddOAuth(AuthenticationBuilder, String, Action<OAuthOptions>)

将基于 OAuth 2.0 的身份验证添加到 AuthenticationBuilder 使用指定的身份验证方案。

AddOAuth(AuthenticationBuilder, String, String, Action<OAuthOptions>)

将基于 OAuth 2.0 的身份验证添加到 AuthenticationBuilder 使用指定的身份验证方案。

AddOAuth<TOptions,THandler>(AuthenticationBuilder, String, Action<TOptions>)

将基于 OAuth 2.0 的身份验证添加到 AuthenticationBuilder 使用指定的身份验证方案。

AddOAuth<TOptions,THandler>(AuthenticationBuilder, String, String, Action<TOptions>)

将基于 OAuth 2.0 的身份验证添加到 AuthenticationBuilder 使用指定的身份验证方案。

AddOpenIdConnect(AuthenticationBuilder, Action<OpenIdConnectOptions>)

将 OpenId Connect 身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

OpenID Connect 是 OAuth 2.0 协议之上的标识层。 它允许客户端请求和接收有关经过身份验证的会话和最终用户的信息。

AddOpenIdConnect(AuthenticationBuilder, String, Action<OpenIdConnectOptions>)

将 OpenId Connect 身份验证添加到 AuthenticationBuilder 使用指定的方案。

OpenID Connect 是 OAuth 2.0 协议之上的标识层。 它允许客户端请求和接收有关经过身份验证的会话和最终用户的信息。

AddOpenIdConnect(AuthenticationBuilder, String, String, Action<OpenIdConnectOptions>)

将 OpenId Connect 身份验证添加到 AuthenticationBuilder 使用指定的方案。

OpenID Connect 是 OAuth 2.0 协议之上的标识层。 它允许客户端请求和接收有关经过身份验证的会话和最终用户的信息。

AddOpenIdConnect(AuthenticationBuilder)

将 OpenId Connect 身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

OpenID Connect 是 OAuth 2.0 协议之上的标识层。 它允许客户端请求和接收有关经过身份验证的会话和最终用户的信息。

AddTwitter(AuthenticationBuilder, Action<TwitterOptions>)

将基于 Twitter OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Twitter 身份验证允许应用程序用户使用其 Twitter 帐户登录。

AddTwitter(AuthenticationBuilder, String, Action<TwitterOptions>)

将基于 Twitter OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Twitter 身份验证允许应用程序用户使用其 Twitter 帐户登录。

AddTwitter(AuthenticationBuilder, String, String, Action<TwitterOptions>)

将基于 Twitter OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Twitter 身份验证允许应用程序用户使用其 Twitter 帐户登录。

AddTwitter(AuthenticationBuilder)

将基于 Twitter OAuth 的身份验证添加到 AuthenticationBuilder 使用默认方案。 默认方案由 AuthenticationScheme.

Twitter 身份验证允许应用程序用户使用其 Twitter 帐户登录。

AddTwoFactorRememberMeCookie(AuthenticationBuilder)

添加用于两个因素的标识 Cookie 记住我。

AddTwoFactorUserIdCookie(AuthenticationBuilder)

添加用于两个因素登录的标识 Cookie。

AddWsFederation(AuthenticationBuilder, Action<WsFederationOptions>)

WsFederationHandler使用默认身份验证方案、显示名称和给定的选项配置注册。

AddWsFederation(AuthenticationBuilder, String, Action<WsFederationOptions>)

WsFederationHandler使用给定的身份验证方案、默认显示名称和给定的选项配置注册。

AddWsFederation(AuthenticationBuilder, String, String, Action<WsFederationOptions>)

WsFederationHandler使用给定的身份验证方案、显示名称和选项配置注册。

AddWsFederation(AuthenticationBuilder)

WsFederationHandler使用默认身份验证方案、显示名称和选项注册。

适用于