The JWT Services will announce some key events for you to listen to
cbSecurity_onJWTCreation
- Whenever a new token is generated for a usercbSecurity_onJWTInvalidation
- Whenever an invalidation occurs for a tokencbSecurity_onJWTValidAuthentication
- Whenever a valid JWT token is parsed, tested and authenticated with the authentication servicescbSecurity_onJWTInvalidUser
- When trying to find the token's subject and the user service returns null or not a valid usercbSecurity_onJWTInvalidClaims
- When the parsed token does not adhere to the required claimscbSecurity_onJWTExpiration
- When the parsed token has expiredcbSecurity_onJWTStorageRejection
- When the parsed token is valid but cannot be found in the permanent storagecbSecurity_onJWTValidParsing
- When the parsed token has passed all validation procedures but has NOT been authenticated yet.
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 |
This event has the following data in the interceptData
struct
Key | Description |
---|---|
token |
The JWT token that was invalidated |
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 |
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 |
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 |
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 |
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 |
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 |
{% code title="interceptors/SecurityAudit.cfc" %}
component extends="coldbox.system.Interceptor"{
function cbSecurity_onJWTCreation( event, interceptData ){
// do what you like here
}
}
{% endcode %}