Skip to content

class JwtBearerEvents

cangjie
public class JwtBearerEvents

功能:提供 JWT Bearer 身份验证事件回调集合。

成员概览

成员功能
var onForbidden禁止访问事件回调。
var onChallenge质询事件回调。
var onTokenValidated令牌验证成功事件回调。
var onMessageReceived消息接收事件回调。
var onAuthenticationFailed身份验证失败事件回调。
func forbidden(ForbiddenContext)触发禁止访问事件。
func challenge(JwtBearerChallengeContext)触发质询事件。
func tokenValidated(TokenValidatedContext)触发令牌验证成功事件。
func messageReceived(MessageReceivedContext)触发消息接收事件。
func authenticationFailed(AuthenticationFailedContext)触发身份验证失败事件。

var onForbidden

cangjie
public var onForbidden: (context: ForbiddenContext) -> Unit =

功能:禁止访问事件回调。

类型:(context: ForbiddenContext) -> Unit

var onChallenge

cangjie
public var onChallenge: (context: JwtBearerChallengeContext) -> Unit =

功能:质询事件回调。

类型:(context: JwtBearerChallengeContext) -> Unit

var onTokenValidated

cangjie
public var onTokenValidated: (context: TokenValidatedContext) -> Unit =

功能:令牌验证成功事件回调。

类型:(context: TokenValidatedContext) -> Unit

var onMessageReceived

cangjie
public var onMessageReceived: (context: MessageReceivedContext) -> Unit =

功能:消息接收事件回调。

类型:(context: MessageReceivedContext) -> Unit

var onAuthenticationFailed

cangjie
public var onAuthenticationFailed: (context: AuthenticationFailedContext) -> Unit =

功能:身份验证失败事件回调。

类型:(context: AuthenticationFailedContext) -> Unit

func forbidden(ForbiddenContext)

cangjie
public func forbidden(context: ForbiddenContext): Unit

功能:触发禁止访问事件。

参数:

返回值:

  • Unit

func challenge(JwtBearerChallengeContext)

cangjie
public func challenge(context: JwtBearerChallengeContext): Unit

功能:触发质询事件。

参数:

返回值:

  • Unit

func tokenValidated(TokenValidatedContext)

cangjie
public func tokenValidated(context: TokenValidatedContext): Unit

功能:触发令牌验证成功事件。

参数:

返回值:

  • Unit

func messageReceived(MessageReceivedContext)

cangjie
public func messageReceived(context: MessageReceivedContext): Unit

功能:触发消息接收事件。

参数:

返回值:

  • Unit

func authenticationFailed(AuthenticationFailedContext)

cangjie
public func authenticationFailed(context: AuthenticationFailedContext): Unit

功能:触发身份验证失败事件。

参数:

返回值:

  • Unit