refactor: Fix some code smells #26
1 changed files with 2 additions and 2 deletions
|
@ -84,8 +84,8 @@ class KeycloakSecurityConfig {
|
|||
List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
|
||||
|
||||
Map<String, Object> realmAccess = jwt.getClaim(REALM_ACCESS_CLAIM);
|
||||
if (realmAccess != null && realmAccess.containsKey("roles")) {
|
||||
List<String> roles = (List<String>) realmAccess.get("roles");
|
||||
if (realmAccess != null && realmAccess.containsKey(ROLES_CLAIM)) {
|
||||
List<String> roles = (List<String>) realmAccess.get(ROLES_CLAIM);
|
||||
for (String role : roles) {
|
||||
grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_" + role));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue