@@ -39,7 +39,7 @@ component accessors="true" singleton {
39
39
" iat" ,
40
40
" sub" ,
41
41
" exp" ,
42
- " scopes "
42
+ " scope "
43
43
];
44
44
45
45
// Default JWT Settings
@@ -189,7 +189,7 @@ component accessors="true" singleton {
189
189
// The unique identifier of the token
190
190
" jti" : hash ( timestamp & arguments .user .getId () ),
191
191
// Get the user scopes for the JWT token
192
- " scopes " : arguments .user .getJwtScopes ()
192
+ " scope " : arguments .user .getJwtScopes (). toList ( " " )
193
193
};
194
194
195
195
// Append user custom claims with override, they take prescedence
@@ -712,7 +712,7 @@ component accessors="true" singleton {
712
712
if ( listLen ( arguments .permissions ) ) {
713
713
// Check if the user has the right permissions?
714
714
results .allow = (
715
- tokenHasScopes ( arguments .permissions , payload .scopes )
715
+ tokenHasScopes ( arguments .permissions , payload .scope )
716
716
||
717
717
variables .cbSecurity
718
718
.getAuthService ()
@@ -731,6 +731,8 @@ component accessors="true" singleton {
731
731
732
732
/**
733
733
* Verify if the jwt token has the appropriate scopes
734
+ * @permission
735
+ * @scopes a space delimited string of scopes
734
736
*/
735
737
private function tokenHasScopes ( required permission , required scopes ){
736
738
if ( isSimpleValue ( arguments .permission ) ) {
@@ -739,7 +741,7 @@ component accessors="true" singleton {
739
741
740
742
return arguments .permission
741
743
.filter ( function ( item ){
742
- return ( scopes .findNoCase ( item ) );
744
+ return ( scopes .listfindNoCase ( item , " " ) );
743
745
} )
744
746
.len ();
745
747
}
0 commit comments