diff --git a/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java b/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java index c37b0bf..7ff32cc 100644 --- a/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java +++ b/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java @@ -84,8 +84,8 @@ class KeycloakSecurityConfig { List grantedAuthorities = new ArrayList<>(); Map realmAccess = jwt.getClaim(REALM_ACCESS_CLAIM); - if (realmAccess != null && realmAccess.containsKey("roles")) { - List roles = (List) realmAccess.get("roles"); + if (realmAccess != null && realmAccess.containsKey(ROLES_CLAIM)) { + List roles = (List) realmAccess.get(ROLES_CLAIM); for (String role : roles) { grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_" + role)); }