-
Notifications
You must be signed in to change notification settings - Fork 44
Issue-1100: Nested & Fallback Claims #1103
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
Conversation
julien-nc
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.
That was fast 🚀
Looks very good.
- You can run
composer run cs:checkandcomposer run cs:fixto make sure you respect the project code style - A little bit of documentation in the README would be nice
- The
OCA\UserOIDC\User\Validator\UserInfoValidatoralso needs adjustments to get the uid - Also one question: Is it possible in some cases (depending on the IdP and its configuration) that a claim with a dot does not result in getting nested attributes in the token? Like "custom.plop" would give a token payload like
{
"custom.plop": "the value",
}If so, we need to make sure this does not break with this new feature. This would mean making the support for nested attributes (and fallback) optional and disabled by default. What do you think?
|
Oh and also if you can sign your commits, that would be awesome. |
d8dd852 to
c18d8a2
Compare
|
Hi @julien-nc, thanks a lot for your super fast and helpful review comments! So, in short: ✅ All commits are now signed Let me know what you think — and thanks again! |
1556da8 to
a737141
Compare
julien-nc
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.
Awesome, thanks for the changes. As this new nestedAndFallbackClaims setting is provider-specific and quite important, it deserves to be set in the UI in my opinion. If you allowed the repo's owners to push in your branch i can add that.
d2f4005 to
6841e85
Compare
I just added you as contributor on my fork. Can you help me, how to allow the repo's owner to push in my branch? |
It's something you chose when creating the PR. I have the right to push in this PR's branch already. I did push a few commits. |
|
verry cool @julien-nc, thanks a lot for your support. |
|
You can squash. I'll read it all again and merge. |
d43c3eb to
5af62e0
Compare
5af62e0 to
63814bb
Compare
|
@dragonpil I realized that the setting was not checked in |
Hi julien-nc, |
|
Hmmm you squashed all your commits in one, then i pushed one on top which only contains a change in the LoginController. |
ah ok... sorry used the compare button and just saw this: so yes I reviewed your change and its fine. |
As described in Issue-1100 there is current no possibility to mappe values which are nested in other than the root scope. To enable this we change the way how Mapping-Attributes are used. They should understand the "." as object seperator. Sometimes you like to have a fallback in your mappings. So for displayname for example please take the nickname (if it exists), if it does not exists take the full name .... To support this, we change the way how Mapping-Attributes are used. They should understand the "|" as an alternative mapping. The functionality is configurable on the provider, either by occ comand and the ui. As default it is deactivated. Signed-off-by: Dragonpil <[email protected]> Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
7224904 to
e28066b
Compare
julien-nc
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.
Thanks again!
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |

As described in Issue-1100 there is current no possibility to mappe values which are nested in other the the root scope. To enable this we change the way how Mapping-Attributes are used. They should understand the . as object seperator.
Sometimes you like to have a fallback in your mappings. So for displayname for example please take the nickname (if it exists), if it does not exists take the full name .... To support this, we change the way how Mapping-Attributes are used. They should understand the | as an alternative mapping.
WIP: Testing need to be done still fully, I dont know if I changed everything needed but on my side it works.
#1100