Skip to main content
For database connections, you can have your users sign in with a username instead of their email address.

Require username

  1. Go to Auth0 Dashboard > Authentication > Database.
  2. Select the name of the connection you want to edit, then select its Attributes tab.
    A database connection's Attributes tab
  3. If Username is not listed on the Attributes tab, select + Add Attribute and then select Username to open the Username Configuration window. If Username is listed on the Attributes tab, select Configure to open the Username Configuration window.
  4. In the Allow Signup with Username section, choose Off, Optional, or Required.
    Enable or disable require username setting
  5. Select Save to save your changes.
To see how this will affect the login screen, select Try Connection. When Allow Signup with Username is set to Required, new users must enter a username and their email address to sign up.
Login form with username
Users can then login with either their username or their email address. Users who registered while usernames were not required do not have a Username field stored and must log in with their email address.

Username length

The default allowed length for usernames is between 1 and 15 characters. However, using the or via the v2, you can modify the length minimum and maximum (up to a maximum length of 128 characters).

Allowed characters

The username field accepts the following characters:
  • Alphanumeric characters (without accent marks, automatically converted to lowercase);
  • The at sign (@) character (but email addresses are not allowed);
  • The caret (^) character;
  • The dollar sign ($) character;
  • The dot (.) character;
  • The exclamation (!) character;
  • The grave accent (`) character;
  • The minus (-) character;
  • The number sign (#) character;
  • The plus (+) character;
  • The single quote (’) character;
  • The tilde (~) character;
  • The underscore (_) character;
No other characters/symbols are allowed, and Auth0 does not validate or sanitize custom database inputs.