Skip to content

Commit

Permalink
[Fix] Set correct default roles claim for Keycloak.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledsoft committed Oct 19, 2023
1 parent 6da9c23 commit d16e03d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/cz/cvut/kbss/termit/util/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,10 @@ public enum ProviderType {

/**
* Claim in the authentication token provided by the OIDC service containing roles mapped to TermIt user roles.
*
* Supports nested objects via dot notation.
*/
private String roleClaim = "realm_access";
private String roleClaim = "realm_access.roles";

public ProviderType getProvider() {
return provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import java.util.List;
import java.util.Map;

/**
* Converts roles claim in an OIDC access token to granted authorities.
*/
public class OidcGrantedAuthoritiesExtractor implements Converter<Jwt, Collection<SimpleGrantedAuthority>> {

private final Configuration.Security config;
Expand Down

0 comments on commit d16e03d

Please sign in to comment.