Skip to content

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)

功能:创建一个身份验证处理器基类实例。

参数:

prop scheme

cangjie
public prop scheme: AuthenticationScheme

功能:返回当前身份验证方案。

类型: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

功能:初始化当前处理器。

参数:

返回值:

  • Unit

func initializeHandler()

cangjie
protected open func initializeHandler(): Unit

功能:初始化当前处理器的扩展状态。

返回值:

  • Unit

func authenticate()

cangjie
public func authenticate(): AuthenticateResult

功能:执行身份验证。

返回值:

func challenge(?AuthenticationProperties)

cangjie
public func challenge(properties: ?AuthenticationProperties): Unit

功能:执行质询处理。

参数:

返回值:

  • Unit

func forbid(?AuthenticationProperties)

cangjie
public func forbid(properties: ?AuthenticationProperties): Unit

功能:执行禁止访问处理。

参数:

返回值:

  • Unit

func handleForbidden(AuthenticationProperties)

cangjie
protected open func handleForbidden(_: AuthenticationProperties): Unit

功能:执行默认的禁止访问处理。

参数:

返回值:

  • Unit

func handleChallenge(AuthenticationProperties)

cangjie
protected open func handleChallenge(_: AuthenticationProperties): Unit

功能:执行默认的质询处理。

参数:

返回值:

  • Unit