-
Notifications
You must be signed in to change notification settings - Fork 49
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
Prioritize groups path over groups claim #767
Conversation
@oemel09 I believe it has to be done somehow differently, something along this line: 1) if the path is set - start with checking it, if it produces nothing, check the It also should be tested |
Question is if the |
So, if the path is configured, check it, otherwise check groups, and in both cases, fallback to the default role if it is set. |
When the With the flow you described it is not possible to use the default role (via |
3308b38
to
5c1f29c
Compare
@oemel09 Can I ask for the clarification. Do you have tokens with the custom |
It's the former, in the |
I changed the implementation in the way you suggested and also added tests to it. |
5c1f29c
to
62025e5
Compare
@oemel09 I've been thinking about it for a while, and came to the conclusion that I was over-thinking about the side-effects. So lets get back to what I believe you were suggesting:
Please do the final update per the above and resolve this issue Thanks for the patience |
I did the changes and adapted the tests. I think I added all the relevant cases, please have a look at them and check if you are okay with all the expected results for each combination. |
implementation/jwt-auth/src/main/java/io/smallrye/jwt/auth/principal/PrincipalUtils.java
Outdated
Show resolved
Hide resolved
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.
@oemel09 Can you please squash commits to only have a single one, with the same name as this PR one ?
You may have to build with Maven if the build fails with formatting errors |
But when the custom path speficied in `smallrye.jwt.path.groups` is empty and no default groups is set via `smallrye.jwt.claims.groups` an existing groups claim will still be used. Signed-off-by: Lukas Ziefle <[email protected]>
eb0eedd
to
cfb6973
Compare
All done 👍 |
Fixes #766
Potentially existing group claims will be overwritten by the claim specified in
smallrye.jwt.path.groups
.