Class CustomJwtAccessTokenConverter

  • All Implemented Interfaces:
    org.springframework.security.oauth2.provider.token.AccessTokenConverter

    public class CustomJwtAccessTokenConverter
    extends org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter
    Implementation of the JwtAccessTokenConverterConfigurer for RAC/KEYCLOAK.
    Author:
    Roger Steuernagel
    See Also:
    DefaultAccessTokenConverter
    • Field Summary

      • Fields inherited from interface org.springframework.security.oauth2.provider.token.AccessTokenConverter

        ATI, AUD, AUTHORITIES, CLIENT_ID, EXP, GRANT_TYPE, JTI, SCOPE
    • Constructor Detail

      • CustomJwtAccessTokenConverter

        public CustomJwtAccessTokenConverter​(com.fasterxml.jackson.databind.ObjectMapper mapper,
                                             TenantConverter tenantConverter)
    • Method Detail

      • extractAuthentication

        public org.springframework.security.oauth2.provider.OAuth2Authentication extractAuthentication​(Map<String,​?> tokenMap)
        Extends the default method to search for roles and user name in RAC/KEYCLOAK's JWT.
        Specified by:
        extractAuthentication in interface org.springframework.security.oauth2.provider.token.AccessTokenConverter
        Overrides:
        extractAuthentication in class org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter