Skip to content
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

Email in login data should be case insensitive. #8548

Closed
sebastianpiskorski opened this issue Aug 11, 2015 · 18 comments
Closed

Email in login data should be case insensitive. #8548

sebastianpiskorski opened this issue Aug 11, 2015 · 18 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@sebastianpiskorski
Copy link
Contributor

In the internet in most cases email address is case insensitive, but unfortunately it is sensitive in Piwik. It should be always normalized at the input so user can use it in the way as they are used to.

@mattab
Copy link
Member

mattab commented Aug 11, 2015

Hi @sebastianpiskorski what is the actual problem or bug that this can cause?

@quba
Copy link
Contributor

quba commented Aug 11, 2015

E.g. a user who copy-pasted the e-mail address may later on try to login using lowercase e-mail address. And for sure this one will be hard to troubleshoot.

@sebastianpiskorski
Copy link
Contributor Author

@mattab
Given:

Got:

  • Login error.

Expected:

  • Piwik successful login.

So i think that email input should be normalized to lower case.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Aug 13, 2015
@mattab mattab added this to the 2.15.0 milestone Aug 13, 2015
@mattab
Copy link
Member

mattab commented Aug 13, 2015

Thanks for the report, we will investigate a fix

@mnapoli
Copy link
Contributor

mnapoli commented Aug 17, 2015

I think I'm missing something: users log into Piwik using their username, not emails. Where is the problem happening?

@quba
Copy link
Contributor

quba commented Aug 17, 2015

But they can enter e-mail as login. This is something to discuss further because forcing lowercase will also force lowercase logins. Maybe we should allow to use capital letters, but force lowercase only while checking if such username exists?

FYI: e-mail is the default username when using Piwik Cloud.

@mnapoli
Copy link
Contributor

mnapoli commented Aug 17, 2015

But they can enter e-mail as login

TIL 😄

So case insensitive for login and email would make sense then? I don't see a reason not to.

@mnapoli mnapoli self-assigned this Aug 17, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Aug 17, 2015

I'm sorry I'm maybe being dense here but I can't login into my Piwik Cloud account or my local dev Piwik using my email (checked several time that it's the correct email). Login in with the username of course works.

In the code, Auth calls $model->getUser($this->login) which search in database only over the login, not the email.

Where/how can we login with emails?

@quba
Copy link
Contributor

quba commented Aug 17, 2015

They can enter e-mail as login while signing up. I mean that login and e-mail are the same. Sorry for confusion.

@halabuda
Copy link

not logging in by way of the actual email field of the user table, but the login field of the user table might contain an email address as its value.

@mnapoli
Copy link
Contributor

mnapoli commented Aug 17, 2015

They can enter e-mail as login while signing up. I mean that login and e-mail are the same. Sorry for confusion.

😖 Sorry, I didn't think of that because when I signed up to the cloud I ended up with the generic username of piwikadmin, so it didn't think more about that use case ;)

Then definitely will be case insensitive for all logins (emails and regular logins) since there's no difference between them.

@quba
Copy link
Contributor

quba commented Aug 17, 2015

Sure, we've changed this on Cloud recently. Cheers!

@sebastianpiskorski
Copy link
Contributor Author

In my opinion users shouldn't be able to have two account which differ only by letter cases. Like "accont_login" and "AccOunt_loGin" shouldn't be two different logins.

@mnapoli
Copy link
Contributor

mnapoli commented Aug 20, 2015

PR: #8610

@mattab
Copy link
Member

mattab commented Aug 21, 2015

I just tried to reproduce this issue:

  • created a user with login = test@test.com
  • then tried creating a user with login = TEST@test.com
  • Got: Login 'test@test.com' already exists.

What is the actual bug- @mnapoli @sebastianpiskorski could you reproduce this or am I doing something wrong

@mattab
Copy link
Member

mattab commented Aug 21, 2015

Ok got tip from @diosmosis " the bug is that the user created an account like: tesT@user.com by mistake and wants to login w/ test@user.com" so I get it now :)

@mnapoli
Copy link
Contributor

mnapoli commented Aug 21, 2015

Or if the user correctly signed up (without "typo") as matt or test@user.com and wants to login as Matt or Test@user.com :)

@quba
Copy link
Contributor

quba commented Aug 21, 2015

@mattab please see #8548 (comment) and #8548 (comment)

This comment: #8548 (comment)
introduced some confusion but I think that now we are one the same page.

Thanks!

diosmosis added a commit that referenced this issue Aug 21, 2015
Fixes #8548, only allow case-insensitive login (while maintaining BC for 2.15 LTS)
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

5 participants