cbSecurity
CommunitySlackSupport
v2.x
v2.x
  • Introduction
  • Intro
    • Release History
      • What's New With 2.15.0
      • What's New With 2.14.0
      • What's New With 2.13.0
      • What's New With 2.12.0
      • What's New With 2.11.x
      • What's New With 2.10.0
      • What's New With 2.9.0
      • What's New With 2.8.0
      • What's New With 2.7.0
      • What's New With 2.6.0
      • What's New With 2.5.0
      • What's New With 2.4.0
      • What's New With 2.3.0
      • What's New With 2.2.0
      • What's New With 2.1.0
      • What's New With 2.0.0
    • About This Book
    • Author
  • Getting Started
    • Installation
    • Overview
    • Configuration
      • Rule Sources
        • DB Rules
        • Inline Rules
        • JSON Rules
        • Model Rules
        • Module Rules
        • XML Rules
  • Usage
    • Authentication Services
    • Security Rules
    • Security Annotations
    • Secured URL
    • Interceptions
    • cbSecurity Model
      • secure() Blocking Methods
      • Verification Methods
      • Authorization Contexts
      • Securing Views
    • Cross Site Request Forgery
  • Security Validators
    • CBAuth Validator
    • CFML Security Validator
    • Custom Validator
  • JWT
    • JWT Services
    • JWT Validator
    • Refresh Tokens
    • Token Storage
    • JWT Interceptions
  • External links
    • Source code
    • Issue Tracker
    • cbauth
    • cbcsrf
    • JWT CFML
Powered by GitBook
On this page
  • cbSecurity_onJWTCreation
  • cbSecurity_onJWTInvalidation
  • cbSecurity_onJWTValidAuthentication
  • cbSecurity_onJWTInvalidUser
  • cbSecurity_onJWTInvalidClaims
  • cbSecurity_onJWTExpiration
  • cbSecurity_onJWTStorageRejection
  • cbSecurity_onJWTValidParsing
  • Example

Was this helpful?

Edit on Git
Export as PDF
  1. JWT

JWT Interceptions

The JWT Services will announce some key events for you to listen to

  • cbSecurity_onJWTCreation - Whenever a new token is generated for a user

  • cbSecurity_onJWTInvalidation - Whenever an invalidation occurs for a token

  • cbSecurity_onJWTValidAuthentication - Whenever a valid JWT token is parsed, tested and authenticated with the authentication services

  • cbSecurity_onJWTInvalidUser - When trying to find the token's subject and the user service returns null or not a valid user

  • cbSecurity_onJWTInvalidClaims - When the parsed token does not adhere to the required claims

  • cbSecurity_onJWTExpiration - When the parsed token has expired

  • cbSecurity_onJWTStorageRejection - When the parsed token is valid but cannot be found in the permanent storage

  • cbSecurity_onJWTValidParsing - When the parsed token has passed all validation procedures but has NOT been authenticated yet.

cbSecurity_onJWTCreation

This event has the following data in the interceptData struct

Key

Description

token

The JWT token

payload

The payload that was used to create it

user

The user it belongs to

cbSecurity_onJWTInvalidation

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was invalidated

cbSecurity_onJWTValidAuthentication

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The payload that was decoded

user

The authenticated user

cbSecurity_onJWTInvalidUser

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The JWT payload that was parsed

cbSecurity_onJWTInvalidClaims

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The JWT payload that was parsed

cbSecurity_onJWTExpiration

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The JWT payload that was parsed

cbSecurity_onJWTStorageRejection

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The JWT payload that was parsed

cbSecurity_onJWTValidParsing

This event has the following data in the interceptData struct

Key

Description

token

The JWT token that was parsed

payload

The JWT payload that was parsed

Example

interceptors/SecurityAudit.cfc
component extends="coldbox.system.Interceptor"{

    function cbSecurity_onJWTCreation( event, interceptData ){
        // do what you like here
    }

}
PreviousToken Storage

Last updated 5 years ago

Was this helpful?