class AuthenticationHandler
cangjie
public abstract class AuthenticationHandler<TOptions> <: IAuthenticationHandler where TOptions <: AuthenticationSchemeOptions功能:提供身份验证处理器的基础实现。
父类型:
成员概览
| 成员 | 功能 |
|---|---|
| init(IOptionsMonitor<TOptions>, ILoggerFactory) | 创建一个身份验证处理器基类实例。 |
| prop scheme | 返回当前身份验证方案。 |
| prop context | 返回当前 HTTP 上下文。 |
| prop logger | 返回当前日志记录器。 |
| prop options | 返回当前处理器选项。 |
| func initialize(AuthenticationScheme, HttpContext) | 初始化当前处理器。 |
| func initializeHandler() | 初始化当前处理器的扩展状态。 |
| func authenticate() | 执行身份验证。 |
| func challenge(?AuthenticationProperties) | 执行质询处理。 |
| func forbid(?AuthenticationProperties) | 执行禁止访问处理。 |
| func handleForbidden(AuthenticationProperties) | 执行默认的禁止访问处理。 |
| func handleChallenge(AuthenticationProperties) | 执行默认的质询处理。 |
init(IOptionsMonitor<TOptions>, ILoggerFactory)
cangjie
protected init(optionsMonitor: IOptionsMonitor<TOptions>, logFactory: ILoggerFactory)功能:创建一个身份验证处理器基类实例。
参数:
- optionsMonitor: IOptionsMonitor<TOptions> - 方案选项监视器。
- logFactory: ILoggerFactory - 日志工厂。
prop scheme
cangjie
public prop scheme: AuthenticationScheme功能:返回当前身份验证方案。
prop context
cangjie
public prop context: HttpContext功能:返回当前 HTTP 上下文。
类型:HttpContext
prop logger
cangjie
public prop logger: ILogger功能:返回当前日志记录器。
类型:ILogger
prop options
cangjie
public prop options: TOptions功能:返回当前处理器选项。
类型:TOptions
func initialize(AuthenticationScheme, HttpContext)
cangjie
public func initialize(scheme: AuthenticationScheme, context: HttpContext): Unit功能:初始化当前处理器。
参数:
- scheme: AuthenticationScheme - 当前身份验证方案。
- context: HttpContext - 当前 HTTP 上下文。
返回值:
Unit
func initializeHandler()
cangjie
protected open func initializeHandler(): Unit功能:初始化当前处理器的扩展状态。
返回值:
Unit
func authenticate()
cangjie
public func authenticate(): AuthenticateResult功能:执行身份验证。
返回值:
- AuthenticateResult - 身份验证结果。
func challenge(?AuthenticationProperties)
cangjie
public func challenge(properties: ?AuthenticationProperties): Unit功能:执行质询处理。
参数:
- properties: ?AuthenticationProperties - 质询附带属性。
返回值:
Unit
func forbid(?AuthenticationProperties)
cangjie
public func forbid(properties: ?AuthenticationProperties): Unit功能:执行禁止访问处理。
参数:
- properties: ?AuthenticationProperties - 禁止访问附带属性。
返回值:
Unit
func handleForbidden(AuthenticationProperties)
cangjie
protected open func handleForbidden(_: AuthenticationProperties): Unit功能:执行默认的禁止访问处理。
参数:
- _: AuthenticationProperties - 禁止访问附带属性。
返回值:
Unit
func handleChallenge(AuthenticationProperties)
cangjie
protected open func handleChallenge(_: AuthenticationProperties): Unit功能:执行默认的质询处理。
参数:
- _: AuthenticationProperties - 质询附带属性。
返回值:
Unit