-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support for multiple custom claim paths to find roles in oidc token #23139
Support for multiple custom claim paths to find roles in oidc token #23139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Markus-Schwer Thanks for opening the issue and proceeding with the PR, it is appreciated.
I'd however prefer your first idea, treat the claim path as a list and run findClaimWithRoles
for every configured path in a loop.
The reason I prefer it is because getting all the roles associated with various clients should not be a default behavior for Keycloak as it can cause unexpected side-effects with the role based access control decisions (false positives/denials).
It would be correct IMHO to require users to list individual paths in such cases:
resource_access/a/roles,resource_access/b/roles
- a bit verbose but also very specific, no unexpected side-effects will happen
Thanks
Hi @sberyozkin Thanks for the fast response and the feedback! |
1f33359
to
c0c4d48
Compare
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
@Markus-Schwer Thanks, LGTM, left one 1 minor comment, please also squash the commits |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 3518656
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: extensions/oidc/deployment
! Skipped: extensions/keycloak-authorization/deployment extensions/oidc-client-filter/deployment extensions/oidc-client-reactive-filter/deployment and 13 more 📦 extensions/oidc/deployment✖
⚙️ JVM Tests - JDK 11 Windows #- Failing: integration-tests/oidc-wiremock
📦 integration-tests/oidc-wiremock✖
⚙️ JVM Tests - JDK 17 #- Failing: extensions/oidc/deployment
! Skipped: extensions/keycloak-authorization/deployment extensions/oidc-client-filter/deployment extensions/oidc-client-reactive-filter/deployment and 13 more 📦 extensions/oidc/deployment✖
⚙️ Native Tests - Security2 #- Failing: integration-tests/oidc-tenancy integration-tests/oidc-wiremock
📦 integration-tests/oidc-tenancy✖
✖
✖
✖
✖
✖
✖
📦 integration-tests/oidc-wiremock✖
|
3518656
to
7870359
Compare
This PR is for #23138 and contains a small code change to allow wildcards in the
quarkus.oidc.roles.role-claim-path
config property. Additionally, this changes the default value for the property fromresource_access/client_id/roles
toresource_access/*/roles
when keycloak is used.