Hi.
I came across very similar concepts in UAA:
- in Workflows, there is a usage of the Interface RoleMappingLoader (Example JwtTokenRoleMappingLoader.java). It offers the possibility to deliver a role-permission-configuration in the JWT Token.
- In Dataservices, this RoleMappingLoader seems to be not used. Instead, I need to create my own GrantedAuthorityConverter.java (Example: UAAGrantedAuthorityConverter) which does nearly the same thing: Loading roles from JWT Token.
Why are there two different concepts for the same thing?
Hi Stefan,
On first look those concepts might look similar because they speak about authority conversion. But they are different.
GrantedAuthorityConverter id bound to oauth2 and it’s responsible to extracting granted authority from token.
See: <INTERNAL_LINK>
RoleMappingLoader in opposite it’s generic (all auth types) and it’s part of the standard user processing - User extension. After user is authenticated based on the auth method you might get authorities from IDP (like OAUTH2 above) then the user get’s created by UserProcessor and there are are able to fill granted authority with access right(s).
See: <INTERNAL_LINK>