lucee.Componentmodels.validators.JwtAuthValidator
Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- This is a JWT authentication validator. It is in charge of validating rules and annotations against an incoming JWT token.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
cbsecurity
|
true
|
false
|
|
any
|
jwtService
|
true
|
false
|
|
any
|
requestService
|
true
|
false
|
Method Summary | |
---|---|
struct
|
annotationValidator(any securedValue, any controller)
This function is called once access to a handler/action is detected. |
struct
|
ruleValidator(any rule, any controller)
This function is called once an incoming event matches a security rule. |
private boolean
|
tokenHasScopes(any permission, any scopes)
Verify if the jwt token has the appropriate scopes. |
any
|
validateSecurity(any permissions)
Validate Security for the jwt token called by an annotation or rule validation event. |
Methods inherited from class lucee.Component |
---|
None |
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- @cbSecurityserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- JwtService@cbSecurityserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:requestServiceserializable
- trueMethod Detail |
---|
This function is called once access to a handler/action is detected. You will receive the secured annotation value and an instance of the ColdBox Controller You must return a struct with two keys: - allow:boolean True, user can continue access, false, invalid access actions will ensue - type:string(authentication|authorization) The type of block that ocurred. Either an authentication or an authorization issue.
securedValue
controller
This function is called once an incoming event matches a security rule. You will receive the security rule that matched and an instance of the ColdBox controller. allow : True, user can continue access, false, invalid access actions will ensue type : Is the issue an authentication or an authorization issue.
rule
controller
Verify if the jwt token has the appropriate scopes
permission
- A list of permissions to validate within a tokenscopes
- A space delimited string of scopesValidate Security for the jwt token called by an annotation or rule validation event
permissions
- The permissions we want to validate in the scopes