-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix: Match token login name by UID or e-mail address #50254
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: master
Are you sure you want to change the base?
Fix: Match token login name by UID or e-mail address #50254
Conversation
With this changes the login name gets matched against the token user's e-mail address in addition to the login name. This fixes the web login flow of the app, where the session is based on the e-mail address but the token uses the UID. Fixes nextcloud#44164 Signed-off-by: Wouter Haffmans <[email protected]>
9e8f6b2 to
c740144
Compare
ChristophWurst
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.
I'm hesitant with this change, because it lifts some of the restrictions of #42971.
| // allow to use the client token with the login name 'user'. | ||
| $tokenUser = $this->manager->get($token->getUID()); | ||
| if (!is_null($tokenUser)) { | ||
| $tokenEmail = $tokenUser->getEMailAddress(); |
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.
What seems missing here is any kind of safe guard to not allow an app token authentication when the email address is not unique. That constraint is used at the user login. You can use your email, but only if the email address is unique. If there are at least two people with the same email, the login will fail.
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 for the feedback, I indeed didn't consider that case. I'll take a further look later.
|
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.) |
Summary
With this changes the login name gets matched against the token user's e-mail address in addition to the login name.
This fixes the web login flow of the app, where the session is based on the e-mail address but the token uses the UID.
TODO
Checklist