Commit 6b20af89 authored by redmitry@list.ru's avatar redmitry@list.ru

prefix roles claim

parent 1057893e
......@@ -47,6 +47,8 @@ import org.keycloak.representations.AccessToken;
@Provider
public class KeycloakRolesFilter implements ContainerRequestFilter {
public final static String ROLES_CLAIM = "oeb:roles";
@Override
public void filter(ContainerRequestContext ctx) throws IOException {
final SecurityContext sc = ctx.getSecurityContext();
......@@ -58,7 +60,7 @@ public class KeycloakRolesFilter implements ContainerRequestFilter {
final AccessToken token = ksc.getToken();
final AccessToken.Access access = token.getRealmAccess();
final Map<String, Object> claims = token.getOtherClaims();
final List roles = (List)claims.get("roles");
final List roles = (List)claims.get(ROLES_CLAIM);
if (roles != null) {
for (Object role : roles) {
access.addRole(role.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment