语言

CookieAuthenticationHandler 类

定义

基于 Cookie 的身份验证处理程序的实现。

public ref class CookieAuthenticationHandler : Microsoft::AspNetCore::Authentication::AuthenticationHandler<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^>, Microsoft::AspNetCore::Authentication::IAuthenticationSignInHandler
public ref class CookieAuthenticationHandler : Microsoft::AspNetCore::Authentication::SignInAuthenticationHandler<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^>
public class CookieAuthenticationHandler : Microsoft.AspNetCore.Authentication.SignInAuthenticationHandler<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions>
public class CookieAuthenticationHandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions>, Microsoft.AspNetCore.Authentication.IAuthenticationSignInHandler
type CookieAuthenticationHandler = class
    inherit SignInAuthenticationHandler<CookieAuthenticationOptions>
type CookieAuthenticationHandler = class
    inherit AuthenticationHandler<CookieAuthenticationOptions>
    interface IAuthenticationSignInHandler
    interface IAuthenticationSignOutHandler
    interface IAuthenticationHandler
Public Class CookieAuthenticationHandler
Inherits SignInAuthenticationHandler(Of CookieAuthenticationOptions)
Public Class CookieAuthenticationHandler
Inherits AuthenticationHandler(Of CookieAuthenticationOptions)
Implements IAuthenticationSignInHandler
继承
继承
实现

构造函数

名称 说明
CookieAuthenticationHandler(IOptionsMonitor<CookieAuthenticationOptions>, ILoggerFactory, UrlEncoder, ISystemClock)
已过时.

初始化新实例 。CookieAuthenticationHandler

CookieAuthenticationHandler(IOptionsMonitor<CookieAuthenticationOptions>, ILoggerFactory, UrlEncoder)

初始化新实例 。CookieAuthenticationHandler

属性

名称 说明
ClaimsIssuer

获取应在发出任何声明时使用的颁发者。

(继承自 AuthenticationHandler<TOptions>)
Clock
已过时.

获取 ISystemClock。

(继承自 AuthenticationHandler<TOptions>)
Context

获取或设置 HttpContext。

(继承自 AuthenticationHandler<TOptions>)
CurrentUri

获取绝对当前 URL。

(继承自 AuthenticationHandler<TOptions>)
Events

处理程序对事件调用方法,这些事件在发生处理的某些点为应用程序控制。 如果未提供默认实例,则会在调用方法时不执行任何操作。

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>)
TimeProvider

获取当前时间,主要用于单元测试。

(继承自 AuthenticationHandler<TOptions>)
UrlEncoder

获取 UrlEncoder。

(继承自 AuthenticationHandler<TOptions>)

方法

名称 说明
AuthenticateAsync()

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

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

构造指定 targetPathURL 的绝对 URL。

(继承自 AuthenticationHandler<TOptions>)
ChallengeAsync(AuthenticationProperties)

质询当前请求。

(继承自 AuthenticationHandler<TOptions>)
CreateEventsAsync()

创建事件实例的新实例。

FinishResponseAsync()

即将发送响应时调用的挂钩

ForbidAsync(AuthenticationProperties)

禁止当前请求。

(继承自 AuthenticationHandler<TOptions>)
HandleAuthenticateAsync()

允许派生类型处理身份验证。

HandleAuthenticateOnceAsync()

用于确保 HandleAuthenticateAsync 只调用一次。 后续调用将返回相同的身份验证结果。

(继承自 AuthenticationHandler<TOptions>)
HandleAuthenticateOnceSafeAsync()

用于确保 HandleAuthenticateAsync 仅安全调用一次。 后续调用将返回相同的身份验证结果。 任何异常都将转换为包含异常的失败身份验证结果。

(继承自 AuthenticationHandler<TOptions>)
HandleChallengeAsync(AuthenticationProperties)

如果相关身份验证方案作为请求流的一部分处理身份验证交互(例如添加响应标头,或者将 401 结果更改为登录页或外部登录位置的 302),请重写此方法来处理 401 质询问题。

HandleForbiddenAsync(AuthenticationProperties)

重写此方法以处理 Forbid。

HandleSignInAsync(ClaimsPrincipal, AuthenticationProperties)

重写此方法以处理 SignIn。

HandleSignOutAsync(AuthenticationProperties)

重写此方法以处理 SignOut。

InitializeAsync(AuthenticationScheme, HttpContext)

初始化处理程序,解析选项并验证它们。

(继承自 AuthenticationHandler<TOptions>)
InitializeEventsAsync()

初始化每个请求调用 InitializeAsync(AuthenticationScheme, HttpContext)一次的事件对象。

(继承自 AuthenticationHandler<TOptions>)
InitializeHandlerAsync()

在初始化选项/事件后调用,以便处理程序完成自身初始化。

ResolveTarget(String)

解析此身份验证操作转发到的方案。

(继承自 AuthenticationHandler<TOptions>)
SignInAsync(ClaimsPrincipal, AuthenticationProperties)

基于 Cookie 的身份验证处理程序的实现。

SignInAsync(ClaimsPrincipal, AuthenticationProperties)

处理登录。

(继承自 SignInAuthenticationHandler<TOptions>)
SignOutAsync(AuthenticationProperties)

基于 Cookie 的身份验证处理程序的实现。

SignOutAsync(AuthenticationProperties)

注销行为。

(继承自 SignOutAuthenticationHandler<TOptions>)

适用于