Requests for comment/Login via e-mail address

From mediawiki.org
Request for comment (RFC)
Login via e-mail address
Component General
Creation date
Author(s) MZMcBride,
Document status in discussion
See Phabricator.

MediaWiki should allow login via e-mail address.

There's a workaround changeset in Gerrit change 229140

Background[edit]

Login via e-mail address is crazy popular on the Web. It's easier for users to remember an e-mail address over a site-specific username.

Considerations[edit]

  • Currently e-mail addresses are case-sensitive.
    • RFC 5321 says Bob@example.com and bob@example.com could theoretically be different e-mail addresses, but in practice that's crazy.
    • Write a maintenance script to normalize e-mail addresses to all lowercase in the database or just check at the application level?
  • E-mail address is considered private information.
  • E-mail addresses do not need to be unique (many accounts with a shared e-mail address happens).
  • Checking passwords is necessarily computationally expensive, so timed attacks are a real concern.
  • There is also CentralAuth to deal with, maybe.
  • Special:PasswordReset already has some of the same functionality/logic we're going to need here.
  • Current error messages for wrong login credential situations are:
    • When user account does exists: "Incorrect password entered. Please try again."
    • When user account doesn't exists: "There is no user by the name "(username)". Usernames are case sensitive. Check your spelling, or create a new account."
  • But unlike usernames, e-mail addresses should be kept in secret. So we have to redesign the error messages to make attackers aren't able to obtain information about whether an specific e-mail address is in the database. --*devunt (talk) 10:47, 30 January 2015 (UTC)[reply]

Workflow[edit]

  • Special:UserLogin is changed to accept e-mail address or username. Yes Done
  • Always try as username first (there are usernames that are e-mail addresses...). Yes Done
  • If e-mail address is authenticated, check password of account. Yes Done
  • We want to avoid timed attacks that can determine whether an e-mail address is in the database. Yes Done
    • Perhaps only check one account total? Yes Done
      • This approach avoids needing to insert an intermediate screen for disambiguation.
    • This would mean that for e-mail addresses that correspond to multiple usernames, you would need to error and tell the user to maybe try an account name instead? (The error message presumably cannot give away that there were e-mail addresses that matched in the database, unless the password also matches.) Yes Done

Implementation details[edit]

The current implementation Gerrit change 229140 behaves like:

  • Display an ambiguous error message when a username, an email address or a password was wrong.
  • Only process to login workflow if an email address is associated with just one account.
  • Email addresses which are not authenticated is completely ignored during login workflow.

Discussion[edit]

In the disucussion tab.

See also[edit]