-
Notifications
You must be signed in to change notification settings - Fork 203
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
EZP-31079: Added way to use login or email (or both) during authentication #2944
Conversation
eZ/Publish/Core/MVC/Symfony/Security/Tests/User/EmailProviderTest.php
Outdated
Show resolved
Hide resolved
Q: apart from the missing documentation that would explain how this feature works in a way that mortal users can understand it, it seems to be missing some enforcing of email unicity:
|
@gggeek It's under Code Review and QA right now. :)
I see heart emoji there, so I think @DominikaK just waits for the "Release the DocTeam" command. :)
It throws exception in case of ambiguity (
I don't think existence of provider (or not) should determine about email uniqueness. We'll think about different configuration switch to turn it on or off. So you may not wan't to login by email at all but still enable "one email per user" rule. |
So you may not want to login by email at all but still enable "one email per user" rule. => agree. It will be nice to be able to enforce this About the correct behaviour in case of 2 accounts sharing the same email: in my experience, it is more common to allow either log in only by email or log in only by login, than allowing to login using both. It is also not uncommon to start out in a configuration where double emails are allowed, and later on the requirements change and login-by-email is enabled and login-by-login is disabled. In this scenario, what would happen to the two accounts that share the same email try to log in? Iirc in ez4 an 'optimistic' route was taken, and the 1st of the two accounts was used for authenticating. Now we have the option of implementing a better logic. I'd say that 'safer' is better, so having LoadUserByEmail throwing is ok. On the other hand, we would then have some users who are unable to log in any more... at the very least we should introduce some tools that help site admins to identify and fix those cases. |
Login has priority over email. So if you use an email address as a login, you'll still be able to login even if you've turned off login by email value.
You'll not be able to login in case of ambiguity. It has to be fixed (or, in case of login provider is also enabled, log in by username).
Definitely. I'm in the middle of writing simple command that will search User database for duplicates (and help you fix them). |
Login has priority over email. So if you use an email address as a login, you'll still be able to login even if you've turned off login by email value. => which is a kind of nice way to allow me to dos you ;-) |
@gggeek Email uniqueness, username restrictions and helper command to audit User database will be covered by another PR. |
*/ | ||
public function loadUsersByEmail($email) | ||
{ | ||
$data = $this->userGateway->loadByEmail($email); |
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.
Could you please double-check if the database index for the e-mail column is defined?
c739c24
to
41b7823
Compare
@Nattfarinn What do we do with known issues? Are you going to resolve them in separate pull request as those seem to be little bit out of scope? Or we intentionally leave them for the time being but it seems to be quite risky. |
a7552c2
to
6383497
Compare
6383497
to
3d47417
Compare
Implemented by eZ kernel v8 in ezsystems/ezpublish-kernel#2944
master
Requires:
security.yaml
:TODO:
$ composer fix-cs
).