Closed
Description
What is the bug?
While uncommon, its possible for JWT claims to contain nested objects. i.e.
{
"sub": "craig",
"attributes": {
"roles": "roleA,roleB"
}
}
With JWT auth, its not possible to configure any JWT-backed auth backend to extract the backend roles from such a structure. When configuring the rolesKey
on any JWT-backed auth backend, it assumes that the roles are a top-level claim of the JWT payload.
Additional Context:
All JWT-backend auth backend extend the AbstractHttpJwtAuthenticator which has an extractRoles method.
This backend assumes that the roles are either comma-separated string or an array of strings.
The rolesKey
could be abstracted to support nesting.