refactor(security): replace string literal with constant key
All checks were successful
Quality Check / Tests (pull_request) Successful in 1m1s
Quality Check / Checkstyle Main (pull_request) Successful in 44s
Build PR / Build and analyze (pull_request) Successful in 1m54s
gitea-sonarqube-bot OK

This commit is contained in:
Jan Gleytenhoover 2024-10-02 09:30:18 +02:00
parent 61d72684c9
commit 8e7b0770de
Signed by: jank
GPG Key ID: B267751B8AE29EFE

@ -83,7 +83,7 @@ class KeycloakSecurityConfig {
jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(jwt -> {
List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
Map<String, Object> realmAccess = jwt.getClaim("realm_access");
Map<String, Object> realmAccess = jwt.getClaim(REALM_ACCESS_CLAIM);
if (realmAccess != null && realmAccess.containsKey("roles")) {
List<String> roles = (List<String>) realmAccess.get("roles");
for (String role : roles) {