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

擴充方法

AddIdentityServerJwt(AuthenticationBuilder)

為與授權伺服器共存的 API 新增驗證處理常式。

AddAzureAD(AuthenticationBuilder, Action<AzureADOptions>)
已淘汰.

將 Azure Active Directory 驗證新增至您的應用程式。

AddAzureAD(AuthenticationBuilder, String, String, String, String, Action<AzureADOptions>)
已淘汰.

將 Azure Active Directory 驗證新增至您的應用程式。

AddAzureADBearer(AuthenticationBuilder, Action<AzureADOptions>)
已淘汰.

為 Azure Active Directory 應用程式將 JWT 持有人驗證新增至您的應用程式。

AddAzureADBearer(AuthenticationBuilder, String, String, Action<AzureADOptions>)
已淘汰.

為 Azure Active Directory 應用程式將 JWT 持有人驗證新增至您的應用程式。

AddAzureADB2C(AuthenticationBuilder, Action<AzureADB2COptions>)
已淘汰.

將 Azure Active Directory B2C 驗證新增至您的應用程式。

AddAzureADB2C(AuthenticationBuilder, String, String, String, String, Action<AzureADB2COptions>)
已淘汰.

將 Azure Active Directory B2C 驗證新增至您的應用程式。

AddAzureADB2CBearer(AuthenticationBuilder, Action<AzureADB2COptions>)
已淘汰.

為 Azure AD B2C 應用程式將 JWT 持有人驗證新增至您的應用程式。

AddAzureADB2CBearer(AuthenticationBuilder, String, String, Action<AzureADB2COptions>)
已淘汰.

為 Azure AD B2C 應用程式將 JWT 持有人驗證新增至您的應用程式。

AddApplicationCookie(AuthenticationBuilder)

新增身分識別應用程式 Cookie。

AddExternalCookie(AuthenticationBuilder)

新增用於外部登入的身分識別 Cookie。

AddIdentityCookies(AuthenticationBuilder)

新增 Cookie 驗證。

AddIdentityCookies(AuthenticationBuilder, Action<IdentityCookiesBuilder>)

新增登入管理員所需的 Cookie 驗證。

AddTwoFactorRememberMeCookie(AuthenticationBuilder)

新增用於兩個因素的身分識別 Cookie 請記住我。

AddTwoFactorUserIdCookie(AuthenticationBuilder)

新增用於兩個因素登入的身分識別 Cookie。

AddBearerToken(AuthenticationBuilder)

新增持有人權杖驗證。 預設配置是由 AuthenticationScheme 指定。

呼叫 即可取得 SignInAsync(HttpContext, String, ClaimsPrincipal) 持有人權杖。

AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>)

新增持有人權杖驗證。 預設配置是由 AuthenticationScheme 指定。

呼叫 即可取得 SignInAsync(HttpContext, String, ClaimsPrincipal) 持有人權杖。

AddBearerToken(AuthenticationBuilder, String)

新增持有人權杖驗證。

呼叫 即可取得 SignInAsync(HttpContext, String, ClaimsPrincipal) 持有人權杖。

AddBearerToken(AuthenticationBuilder, String, Action<BearerTokenOptions>)

新增持有人權杖驗證。

呼叫 即可取得 SignInAsync(HttpContext, String, ClaimsPrincipal) 持有人權杖。

AddCertificate(AuthenticationBuilder)

新增憑證驗證。

憑證驗證會使用驗證用戶端憑證的驗證處理常式,並引發憑證解析為 ClaimsPrincipal 的事件。 請參閱 https://tools.ietf.org/html/rfc5246#section-7.4.4 深入瞭解憑證驗證。

AddCertificate(AuthenticationBuilder, 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, String, Action<CertificateAuthenticationOptions>)

新增憑證驗證。

憑證驗證會使用驗證用戶端憑證的驗證處理常式,並引發憑證解析為 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)

使用預設配置將 Cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由 AuthenticationScheme 指定。

Cookie 驗證會使用保存在用戶端中的 HTTP Cookie 來執行驗證。

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

使用預設配置將 Cookie 驗證新增至 AuthenticationBuilder 。 預設配置是由 AuthenticationScheme 指定。

Cookie 驗證會使用保存在用戶端中的 HTTP Cookie 來執行驗證。

AddCookie(AuthenticationBuilder, String)

使用指定的配置,將 Cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP Cookie 來執行驗證。

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

使用指定的配置,將 Cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP Cookie 來執行驗證。

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

使用指定的配置,將 Cookie 驗證新增至 AuthenticationBuilder

Cookie 驗證會使用保存在用戶端中的 HTTP Cookie 來執行驗證。

AddFacebook(AuthenticationBuilder)

將 Facebook OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Facebook 驗證可讓應用程式使用者使用其 Facebook 帳戶登入。

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 帳戶登入。

AddGoogle(AuthenticationBuilder)

將 Google OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Google 驗證可讓應用程式使用者使用其 Google 帳戶登入。

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 帳戶登入。

AddJwtBearer(AuthenticationBuilder)

使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。

JWT 持有人驗證會從 Authorization 要求標頭擷取和驗證 JWT 權杖,以執行驗證。

AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>)

使用預設配置 AuthenticationScheme 啟用 JWT 持有人驗證。

JWT 持有人驗證會從 Authorization 要求標頭擷取和驗證 JWT 權杖,以執行驗證。

AddJwtBearer(AuthenticationBuilder, String)

使用預先定義的配置來啟用 JWT 持有人驗證。

JWT 持有人驗證會從 Authorization 要求標頭擷取和驗證 JWT 權杖,以執行驗證。

AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>)

使用指定的配置啟用 JWT 持有人驗證。

JWT 持有人驗證會從 Authorization 要求標頭擷取和驗證 JWT 權杖,以執行驗證。

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

使用指定的配置啟用 JWT 持有人驗證。

JWT 持有人驗證會從 Authorization 要求標頭擷取和驗證 JWT 權杖,以執行驗證。

AddMicrosoftAccount(AuthenticationBuilder)

將 Microsoft 帳戶 OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Microsoft 帳戶驗證可讓應用程式使用者使用其公司、學校或個人 Microsoft 帳戶登入。

AddMicrosoftAccount(AuthenticationBuilder, Action<MicrosoftAccountOptions>)

將 Microsoft 帳戶 OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Microsoft 帳戶驗證可讓應用程式使用者使用其公司、學校或個人 Microsoft 帳戶登入。

AddMicrosoftAccount(AuthenticationBuilder, String, Action<MicrosoftAccountOptions>)

將 Microsoft 帳戶 OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Microsoft 帳戶驗證可讓應用程式使用者使用其公司、學校或個人 Microsoft 帳戶登入。

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

將 Microsoft 帳戶 OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Microsoft 帳戶驗證可讓應用程式使用者使用其公司、學校或個人 Microsoft 帳戶登入。

AddNegotiate(AuthenticationBuilder)

使用 AuthenticationBuilder 預設配置 AuthenticationScheme ,將 設定為使用交涉 (也稱為 Windows、Kerberos 或 NTLM) 驗證。

此驗證處理常式支援 Windows 和 Linux 伺服器上的 Kerberos。

AddNegotiate(AuthenticationBuilder, Action<NegotiateOptions>)

設定 AuthenticationBuilder 使用預設配置使用交涉 (也稱為 Windows、Kerberos 或 NTLM) 驗證。 預設配置是由 AuthenticationScheme 指定。

此驗證處理常式支援 Windows 和 Linux 伺服器上的 Kerberos。

AddNegotiate(AuthenticationBuilder, String, Action<NegotiateOptions>)

AuthenticationBuilder 設定為使用交涉 (也稱為 Windows、Kerberos 或 NTLM) 使用指定的驗證配置進行驗證。

此驗證處理常式支援 Windows 和 Linux 伺服器上的 Kerberos。

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

AuthenticationBuilder 設定為使用交涉 (也稱為 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)

將 OpenId Connect 驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

OpenID Connect 是 OAuth 2.0 通訊協定之上的身分識別層。 它可讓用戶端要求和接收已驗證會話和終端使用者的相關資訊。

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 通訊協定之上的身分識別層。 它可讓用戶端要求和接收已驗證會話和終端使用者的相關資訊。

AddTwitter(AuthenticationBuilder)

將 Twitter OAuth 型驗證新增至 AuthenticationBuilder 使用預設配置。 預設配置是由 AuthenticationScheme 指定。

Twitter 驗證可讓應用程式使用者使用其 Twitter 帳戶登入。

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 帳戶登入。

AddWsFederation(AuthenticationBuilder)

WsFederationHandler使用預設驗證配置、顯示名稱和選項來註冊 。

AddWsFederation(AuthenticationBuilder, Action<WsFederationOptions>)

WsFederationHandler使用預設驗證配置、顯示名稱和指定的選項群組態來註冊 。

AddWsFederation(AuthenticationBuilder, String, Action<WsFederationOptions>)

WsFederationHandler使用指定的驗證配置、預設顯示名稱和指定的選項群組態來註冊 。

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

WsFederationHandler使用指定的驗證配置、顯示名稱和選項群組態來註冊 。

適用於