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
继承
继承
实现

构造函数

名称 说明
OpenIdConnectHandler(HttpClient, HtmlEncoder)

OpenIdConnectAuthenticationMiddleware 的按请求身份验证处理程序。

OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder, ISystemClock)
已过时.

初始化 的新 OpenIdConnectHandler实例。

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

初始化 的新 OpenIdConnectHandler实例。

属性

名称 说明
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>)

方法

名称 说明
AuthenticateAsync()

对当前请求进行身份验证。

(继承自 AuthenticationHandler<TOptions>)
BuildRedirectUri(String)

构造指定 targetPathURL 的绝对 URL。

(继承自 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>)

适用于