As follow up to my previous issue, I think it would be nice to allow email address to be set as username for login. Or at least don't require username field and default it to use email address. This is a use case for Facebook login which allows email address be used as username for login.

When I try to run

"name": { "value": "[email protected]" },
"mail": { "value": "[email protected]" }

I am getting response

    "message": "Unprocessable Entity: validation failed.\nname: The username can not be an email address.\n"
  • May be you can use drupal.org/project/email_registration the mentioned module and implement the hook given by this module. Commented Feb 27, 2018 at 5:05
  • 1
    I think it would be nice to allow email address to be set as username I don't. Imagine if my Drupal Answers user name was my e-mail address. Do you know how much spam I would get?
    – No Sssweat
    Commented Feb 27, 2018 at 5:05
  • Using openid_connect module, when it is configured with facebook, we successfully register a user, and when check /user/USER_ID/edit?destination=/admin/people we see that the username has equal value of email address. Commented Feb 27, 2018 at 5:42
  • What I mean is at least, we allow email to be set as username. Not entirely making email equivalent to username. In facebook, we use mobile #, email address and username to login. Commented Feb 27, 2018 at 7:22
  • drupal.org/project/logintoboggan
    – Christia
    Commented Feb 27, 2018 at 10:00

3 Answers 3


I use the Email Registration module.

Once enabled, during login the email address is required instead of the username. Usernames still cannot be email addresses, but usernames become irrelevant from a UX perspective.

From the module description:

This module aims to solve some usability issues in managing accounts on a Drupal site.

  1. On many sites the idea of a "username" is not necessary while the email is necessary. This module lets users register and login using only their email address and not worry about a username.
  2. In general the fewer fields on a form the easier it is for people to finish the task. This module lets sites use just an email for registration form. How simple is just one form? So simple.
  3. This module can be configured to allow a username as well for sites where that is important. In these cases, users get the benefit of being able to login with username or email which is helpful in case a user tries to login with their email (they are likely to remember their email even if they forgot their username).

My module Login with Email only should solve that:

This simple Drupal 8 module allows users to log in exclusively with their email address from the standard login form.


Just enable the module.

Recommended Modules:

This module is based on the Login Email or Username module: https://www.drupal.org/project/login_emailusername


Use this module


This module enables users to login by email address with the minimal configurations. For configuring mail login go to "/admin/config/people/mail-login". Available configurations:

Enable login by email address: This option enables login by email address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.