-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Allows OIDC integration to handle the case where a user only has a single group #22723
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
base: main
Are you sure you want to change the base?
Conversation
…ngle group Signed-off-by: Lars Francke <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22723 +/- ##
===========================================
+ Coverage 45.36% 65.86% +20.49%
===========================================
Files 244 1073 +829
Lines 13333 116281 +102948
Branches 2719 2931 +212
===========================================
+ Hits 6049 76586 +70537
- Misses 6983 35447 +28464
- Partials 301 4248 +3947
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Thanks for running the tests. I'm not entirely sure what the actual failure is for the UTTEST run. There are a bunch of Errors in there but they don't seem to stop the build. I'm not very familiar with this :( |
|
@lfrancke Thanks for this PR.
Could you please point out which section in the RFC has such statements? I tried to find it but only found has statement about But this does not have to be applicable to |
|
I have to admit that this (the original issue) is where I took that claim from. I'm happy to remove the comment from the PR. I agree: I can't find any reference to it in the RFC itself. FWIW I've also opened a support case with JumpCloud |
Signed-off-by: Vadim Bauer <[email protected]>
|
While the RFC751 is not clear, many OIDC implementations support both use cases. I looked into Dex, which supports both string for a single entry and array for multiple entries. There is no harm in adding this fix, as it won't break backwards compatibility. |
Vad1mo
left a comment
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.
patch verified
@Vad1mo I really doubt it, I tested with Dex, which was years ago, but I recall Dex sets an array in "groups" claim, not single string. My point is, if we have multiple mainstream OIDC providers which set single string in the "groups" claim I'm fine with this PR. But if it's only JumpCloud we probably wanna keep it in the fork, b/c it seems to me that this is an implementation issue in JumpCloud. I don't think we should update the code again when we see some oidc provider tries to put a map in the "groups" claim. |
|
It's not only JumpCloud. The original issue was opened by someone else using "IdentityServer 4". PingFederate does the same and I'm 99% certain that I've seen others with the same behavior. There does not seem to be a spec for the groups claim either so to me it seems reasonable to support "what's out there". We solved it for us by just assigning a second dummy group so it's not a big problem but it'll make the lives of others easier at very little cost. |
Comprehensive Summary of your change
See the linked issue for details on the issue.
This PR first tries to parse all claims as an array first and if that fails it will try to parse it as a string.
The internal UserInfo struct is unchanged.
Note
I tried to run the tests and I tried to build Harbor and run it locally but I failed miserably.
a) I couldn't get the tests to run (failed on a Postgres requirement)
b) I was able to build using
make installbut I couldn't get the docker images to actually run due to some permissions issue (the images seem to requireroot?)I understand if you don't want to accept this PR untested and I might try again next week but for now...this is it :)
Issue being fixed
Fixes #15416
Please indicate you've done the following: