Commit 21b00367 authored by Simon Reis's avatar Simon Reis
Browse files

SI-2183-Keycloak-Client-Rollen

parent 0e2c8e16
......@@ -85,7 +85,9 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
token.getResourceAccess().forEach((client, access) -> allRoles.addAll(access.getRoles()));
//Realmroles
allRoles.addAll(token.getRealmAccess().getRoles());
if (token.getRealmAccess() != null) {
allRoles.addAll(token.getRealmAccess().getRoles());
}
List<GrantedAuthority> authorities= new ArrayList<>();
allRoles.forEach( x -> authorities.add(new SimpleGrantedAuthority("ROLE_"+x.toUpperCase())));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment