Modify username requirements with auth0 sign up widget

Where can I modify the character requirement shown below when signing up using the auth widget?

Use 1-30 letters, numbers and the following characters: “_”, “.”, “+”, “-”

The username length can be changed under Authentication > Database
I would think the character requirement would be with it?


Screen Shot 2022-03-14 at 8.35.13 PM

Hi @molly.kelsey,

Thanks for reaching out to the Auth0 Community!

I understand that you would like to modify the username character limit for your application.

To do so, you will need to navigate to your Auth0 Dashboard > Authentication > Database > YOUR_DATABASE > and change the Username Length for your connection. See below.

Once you have done so, you will have complete control over the username character limit.

Lastly, the Username Length has a maximum of up to 128 characters and accepts only these allowed characters.

Please let me know if you have any additional questions.

Thank you.

Thanks. I’ve found that. I would like to remove the requirements of the special characters. Is that possible?

Hi @molly.kelsey,

Thank you for your response.

Unfortunately, it is not possible. And for clarification, the message states that you must use between 1-30 characters using only letters, numbers, and the following characters defined. It is not a requirement to use all characters.

Moreover, our Allowed Characters doc describes that only the following characters are allowed for the username field:

  • 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.

Hoped that helps!

Please let me know if there’s anything else you need clarification on or have any questions.

Thank you.

Thank you, that’s helpful. I guess I was confused by the messaging and thought one of those special characters were required.

Is it possible to modify that error message somewhere?

1 Like

Hi @molly.kelsey,

Thank you for your reply.

Yes, it is possible. You can modify this error message on your Custom Universal Login Page in the langaugeDictionary Object. Specifically, you will need to change the usernameFormatErrorHint error message. See below for an example:

var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
  //... Options redacted for brevity
  languageDictionary: {
    usernameFormatErrorHint: '[Test] Use %d-%d letters, numbers and the following characters: "_", ".", "+", "-"'

Here is an example screenshot:

Lastly, please visit the Language Dictionary Specification for the complete list of languageDictionary values able to be modified with this object.

Please let me know if you have any additional questions.

Thank you.