# Additional special characters required in username - \* & %

**URL:** <https://community.auth0.com/t/additional-special-characters-required-in-username/204285>\
**Category:** Get Help\
**Tags:** username\
**Created:** [October 15, 2026, 7:07am UTC](https://community.auth0.com/t/additional-special-characters-required-in-username/204285 "2026-10-15T07:07:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karuissobusy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/karuissobusy/32/80340_2.png) [@karuissobusy](https://community.auth0.com/u/karuissobusy)\
**Post date:** [October 15, 2026, 7:07am UTC](https://community.auth0.com/t/additional-special-characters-required-in-username/204285/1 "2026-10-15T07:07:41Z")

</div>

We are doing lazy migration where the existing DB has a lot of account with some special characters that aren’t allowed in Auth0 like `*` `&` `%`

What options do we have?

Cheers,  
Karthick.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [October 15, 2026, 7:51pm UTC](https://community.auth0.com/t/additional-special-characters-required-in-username/204285/2 "2026-10-15T19:51:30Z")

</div>

Hi @karuissobusy

Thank you for reaching out to us!

I understand you are asking which options are available for a lazy migration from an existing database when many accounts have usernames containing characters that Auth0 does not accept in usernames, such as `*`, `&`, and `%`.

**Recommended Solution**

Keep the legacy usernames in a separate field and use email or a sanitized username as the Auth0 identifier, so the migration does not depend on the special characters being valid in Auth0.

As the characters you mention are not in the set of [accepted username characters](https://auth0.com/docs/authenticate/database-connections/require-username#allowed-characters), usernames containing them cannot be stored as-is and we can recommend one of the following options, depending on which best fits your implementation.

**Option A:** Keep usernames and transform them during migration (recommended if login by legacy username must continue)

1. **Map** each legacy username to an allowed value in your custom database login and get-user scripts. For example, replace \* with a permitted character such as \_ and keep the original value in the user profile’s user\_metadata or app\_metadata.
2. **Return** the transformed value in the username property of the profile object passed to the callback, because the connection has Requires Username enabled.
3. **Check** that login works with both the transformed username and the user’s email, since Auth0 authenticates with either when Requires Username is enabled.

**Option B:** Use email as the primary identifier (recommended if legacy usernames are not a strict requirement)

1. **Disable** Requires Username in the Database Connection settings if your users can sign in with email.
2. **Import** users with their email address as the unique identifier. Store the legacy username in user\_metadata so it remains searchable for support and reconciliation.

**Option C:** Use a [Pre User Registration Action](https://auth0.com/docs/customize/actions/explore-triggers/pre-user-registration) for new sign-ups

- **Create** a Pre User Registration Action to reject or normalize usernames that contain disallowed characters on new sign-ups.

Allow me to share some additional Knowledge Articles which should prove useful:

- [Characters in Username with Custom Database Connections](https://support.auth0.com/center/s/article/Characters-in-Username-with-custom-database-connections);
- [Usernames and special characters](https://support.auth0.com/center/s/article/Usernames-and-special-characters).

Hope this information helped you achieve the desired flow and complete the migration!

Have a great one,  
Gerald

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 25, 2026, 7:51pm UTC](https://community.auth0.com/t/additional-special-characters-required-in-username/204285/3 "2026-10-25T19:51:44Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
