[keycloak-user] Authorization : Scope cannot be added to multiple permission

Bruce Wings testoauth55 at gmail.com
Wed Dec 12 05:20:45 EST 2018


(The configuration discussed below is done under the Authorization tab)

I have created Authorization Scope. When I create 2 scope based permissions
: *Perm1 and Perm2 *and add this scope to both, *no error is shown and
scope is successfully added.*

But when I look at the scopes at my client end, I see that only 1
permission has that scope. (scope gets reflected in whichever permission is
added at the end. It gets disappeared from previous permission). Is this
the intended behavior?

The way I checked the scopes is by intercepting request and obtaining
permission list in my Java client.

*KeycloakSecurityContext keycloakSecurityContext =
(KeycloakSecurityContext)
request.getAttribute(KeycloakSecurityContext.class.getName());*
*AuthorizationContext authzContext =
keycloakSecurityContext.getAuthorizationContext();*
*List<Permission> permList = (authzContext==null) ? null :
authzContext.getPermissions();*
*for(Permission perm : permList) {*
*    Set<String> scopeList = perm.getScopes();*
*        // other stuff*
*}*


More information about the keycloak-user mailing list