Class KeycloakRealmAuthoritiesConverter
java.lang.Object
io.quantics.multitenant.oauth2.config.AbstractJwtGrantedAuthoritiesConverter
io.quantics.multitenant.oauth2.config.KeycloakRealmAuthoritiesConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
Converter for converting a Keycloak-issued
Jwt into GrantedAuthorities.
The converter uses the roles inside the realm_access claim for mapping to granted authorities.
Each role is prefixed with ROLE_ for ensuring compatibility with the Spring framework.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<org.springframework.security.core.GrantedAuthority>convert(org.springframework.security.oauth2.jwt.Jwt jwt) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
KeycloakRealmAuthoritiesConverter
public KeycloakRealmAuthoritiesConverter()
-
-
Method Details
-
convert
public Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt)
-