-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clients roles #366
Comments
hi, thanks for creating issue! Yup i think it is valid use case, i think problem why it wasn't implemented is that you don't know ahead of time what will be the key for roles, i will think about solutions for this problem |
@p53 thanks! |
@hillout @RadikSeyfullin checked now code + documentation, your use case is actually there supported, as you can see in example in docs in several places there is:
so it gathers realm roles + client roles from token and matches against these it does not work for you? I can make docu more explicit about roles |
@p53 thanks. Its work for me now. I didn't understand that when I was reading the documentation( |
will update docs to be more helpful |
@RadikSeyfullin hi, it doesn't work for me now, maybe I configure it wrong, here is what I've tried:
And:
|
@hillout did you setup client role, not custom claim right? |
@RadikSeyfullin @p53 my mistake, it's working with -
Otherwise you'll get the error, cuz default is Also doesn't work without specifying the uri=/*, so you can't put like this Would be handful if you could specify the roles as a standalone flag: Document should definitely be updated, can contribute. |
probably this in docu will need update, i will check code to confirm:
that error was added because some users were trying to use both at once, hoping that those rules from default-deny+resources will combine, which is not the case, default-deny is just convenient default |
@hillout if i correctly understand your third case, this is also supported by https://gogatekeeper.github.io/gatekeeper/userguide/#claim-matching (see last example in section) |
@p53 hi, confirm, all is working, Thanks! |
Hi, here are some issues which I find noticeable.
Unable to use clients roles for authorization
Now configuring roles by --resources="uri=/*|roles=services" gatekeeper parses data from token which includes Realm roles in Keycloak only, example:
part of token which contains the realm role:
And it works, meaning that user is being authorized based on role in the example.
However, if I assign a client's role, it doesn't work. And in this case token contains this part of role in this form:
Authorization doesn't work. I get error 403 Access to domain.org was denied. But at the same time I can see in Keycloak an active user session in that client (app-1). But I suppose it's the correct behavior.
the log output says:
I also tried to use a Client role mapper, where I can define myself token claim for the role, in this case it doesn't work either. Here is the mapper, and how it looks in token:
Token:
Options
Would be great if there was an option to configure using this roles for example by this keys:
I think that most people handle all cases using only first two options.
The text was updated successfully, but these errors were encountered: