From 8e7b0770de3e0e6b623d2db61b68b28ee99de4cc Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 2 Oct 2024 09:30:18 +0200 Subject: [PATCH] refactor(security): replace string literal with constant key --- .../de/szut/lf8_starter/security/KeycloakSecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8ab3fd8..c37b0bf 100644 --- a/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java +++ b/src/main/java/de/szut/lf8_starter/security/KeycloakSecurityConfig.java @@ -83,7 +83,7 @@ class KeycloakSecurityConfig { jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(jwt -> { List grantedAuthorities = new ArrayList<>(); - Map realmAccess = jwt.getClaim("realm_access"); + Map realmAccess = jwt.getClaim(REALM_ACCESS_CLAIM); if (realmAccess != null && realmAccess.containsKey("roles")) { List roles = (List) realmAccess.get("roles"); for (String role : roles) {