I'm using Spring Boot Keycloak Adapter in my backend application. It has properties for extracting roles from JWT token:
keycloak:
use-resource-roles-mapping: true
If this option is set to true
, then the toles of user will be extracted from token from the field resource_access.roles[]
If this option is set to false
, then the roles of user will be extracted from token from the field realm_access.roles[]
But I have roles in my token in another field, roles[]
are placed in root directly, without wrappers resource_access
or realm_access
As I see, Keycloak adapter does not allow to customize the behaviour of extracting roles from token. So, the question is, how do I ovveride this behaviour to extract roles from token from the field I want?