語言

OpenIdConnectHandler 類別

定義

OpenIdConnectAuthenticationMiddleware 的每個要求驗證處理程式。

public ref class OpenIdConnectHandler : Microsoft::AspNetCore::Authentication::RemoteAuthenticationHandler<Microsoft::AspNetCore::Builder::OpenIdConnectOptions ^>
public ref class OpenIdConnectHandler : Microsoft::AspNetCore::Authentication::RemoteAuthenticationHandler<Microsoft::AspNetCore::Authentication::OpenIdConnect::OpenIdConnectOptions ^>, Microsoft::AspNetCore::Authentication::IAuthenticationSignOutHandler
public class OpenIdConnectHandler : Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<Microsoft.AspNetCore.Builder.OpenIdConnectOptions>
public class OpenIdConnectHandler : Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectOptions>, Microsoft.AspNetCore.Authentication.IAuthenticationSignOutHandler
type OpenIdConnectHandler = class
    inherit RemoteAuthenticationHandler<OpenIdConnectOptions>
type OpenIdConnectHandler = class
    inherit RemoteAuthenticationHandler<OpenIdConnectOptions>
    interface IAuthenticationSignOutHandler
    interface IAuthenticationHandler
Public Class OpenIdConnectHandler
Inherits RemoteAuthenticationHandler(Of OpenIdConnectOptions)
Public Class OpenIdConnectHandler
Inherits RemoteAuthenticationHandler(Of OpenIdConnectOptions)
Implements IAuthenticationSignOutHandler
繼承
繼承
實作

建構函式

名稱 Description
OpenIdConnectHandler(HttpClient, HtmlEncoder)

OpenIdConnectAuthenticationMiddleware 的每個要求驗證處理程式。

OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder, ISystemClock)
已淘汰.

初始化 OpenIdConnectHandler 的新執行個體。

OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder)

初始化 OpenIdConnectHandler 的新執行個體。

屬性

名稱 Description
Backchannel

它被 HttpClient 用來與遠端身份提供者通訊。

ClaimsIssuer

取得發行任何宣告時應該使用的簽發者。

(繼承來源 AuthenticationHandler<TOptions>)
Clock
已淘汰.

取得 ISystemClock。

(繼承來源 AuthenticationHandler<TOptions>)
Context

取得或設定 HttpContext。

(繼承來源 AuthenticationHandler<TOptions>)
CurrentUri

取得絕對目前的URL。

(繼承來源 AuthenticationHandler<TOptions>)
Events

處理程式會在事件上呼叫方法,以在處理發生時的特定時間點提供應用程控。 如果未提供預設實例,則會在呼叫 方法時執行任何動作。

HtmlEncoder

取得 HtmlEncoder。

Logger

取得 ILogger。

(繼承來源 AuthenticationHandler<TOptions>)
Options

取得或設定與這個驗證處理程式相關聯的選項。

(繼承來源 AuthenticationHandler<TOptions>)
OptionsMonitor

能偵測 IOptionsMonitor<TOptions> 選項變更。

(繼承來源 AuthenticationHandler<TOptions>)
OriginalPath

取得驗證中間件所見的路徑。

(繼承來源 AuthenticationHandler<TOptions>)
OriginalPathBase

取得驗證中間件所見的路徑基底。

(繼承來源 AuthenticationHandler<TOptions>)
Request

會收到與目前請求相關的資訊 HttpRequest 。

(繼承來源 AuthenticationHandler<TOptions>)
Response

會收到與目前請求相關的資訊 HttpResponse 。

(繼承來源 AuthenticationHandler<TOptions>)
Scheme

取得或設定與此認證處理程序相關的 。AuthenticationScheme

(繼承來源 AuthenticationHandler<TOptions>)
SignInScheme

預設用於登入的驗證配置。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
TimeProvider

取得目前時間,主要是用於單元測試。

(繼承來源 AuthenticationHandler<TOptions>)
UrlEncoder

取得 UrlEncoder。

(繼承來源 AuthenticationHandler<TOptions>)

方法

名稱 Description
AuthenticateAsync()

驗證目前的要求。

(繼承來源 AuthenticationHandler<TOptions>)
BuildRedirectUri(String)

為指定的 targetPath建構一個絕對網址。

(繼承來源 AuthenticationHandler<TOptions>)
ChallengeAsync(AuthenticationProperties)

挑戰目前的要求。

(繼承來源 AuthenticationHandler<TOptions>)
CreateEventsAsync()

建立事件實例的新實例。

ForbidAsync(AuthenticationProperties)

禁止目前的要求。

(繼承來源 AuthenticationHandler<TOptions>)
GenerateCorrelationId(AuthenticationProperties)

產生包含 Nonce 的 Cookie,用來將目前的遠端驗證要求相互關聯。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, AuthenticationTicket)

移至 UserInfo 端點以擷取其他宣告,並將任何唯一宣告新增至指定的身分識別。

GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, ClaimsPrincipal, AuthenticationProperties)

移至 UserInfo 端點以擷取其他宣告,並將任何唯一宣告新增至指定的身分識別。

HandleAccessDeniedErrorAsync(AuthenticationProperties)

衍生類型可能會覆寫此方法來處理拒絕存取錯誤。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
HandleAuthenticateAsync()

允許衍生類型處理驗證。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
HandleAuthenticateOnceAsync()

用來確保 HandleAuthenticateAsync 只會叫用一次。 後續呼叫會傳回相同的驗證結果。

(繼承來源 AuthenticationHandler<TOptions>)
HandleAuthenticateOnceSafeAsync()

用來確保 HandleAuthenticateAsync 只會安全地叫用一次。 後續呼叫會傳回相同的驗證結果。 任何例外狀況都會轉換成包含例外狀況的失敗驗證結果。

(繼承來源 AuthenticationHandler<TOptions>)
HandleChallengeAsync(AuthenticationProperties)

回應 401 挑戰。 將 OpenIdConnect 訊息傳送至「身分識別授權單位」,以取得身分識別。

HandleForbiddenAsync(AuthenticationProperties)

覆寫此方法以處理 Forbid。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
HandleRemoteAuthenticateAsync()

叫用以處理傳入的 OpenIdConnect 訊息。

HandleRemoteSignOutAsync()

處理身份提供者發送的遠端登出請求。

HandleRequestAsync()

處理目前的驗證要求。

HandleSignOutAsync(SignOutContext)

將使用者重新導向至身分識別提供者以進行註銷

HandleSignOutCallbackAsync()

在會話結束之後,回應OpenId提供者的回呼。

HandleUnauthorizedAsync(ChallengeContext)

回應 401 挑戰。 將 OpenIdConnect 訊息傳送至「身分識別授權單位」,以取得身分識別。

InitializeAsync(AuthenticationScheme, HttpContext)

初始化處理程式,解析選項並加以驗證。

(繼承來源 AuthenticationHandler<TOptions>)
InitializeEventsAsync()

初始化事件物件,每個請求被 InitializeAsync(AuthenticationScheme, HttpContext)呼叫一次。

(繼承來源 AuthenticationHandler<TOptions>)
InitializeHandlerAsync()

在已初始化選項/事件之後呼叫,處理程式完成初始化本身。

(繼承來源 AuthenticationHandler<TOptions>)
RedeemAuthorizationCodeAsync(OpenIdConnectMessage)

在令牌端點兌換令牌的授權碼。

ResolveTarget(String)

解析此驗證作業轉送至的配置。

(繼承來源 AuthenticationHandler<TOptions>)
ShouldHandleRequestAsync()

會獲得一個值,決定目前的認證請求是否應該由 HandleRequestAsync()處理。

(繼承來源 RemoteAuthenticationHandler<TOptions>)
SignOutAsync(AuthenticationProperties)

將使用者重新導向至身分識別提供者以進行註銷

ValidateCorrelationId(AuthenticationProperties)

驗證目前的要求是否與目前的遠端驗證要求相互關聯。

(繼承來源 RemoteAuthenticationHandler<TOptions>)

適用於