# Login identifier as either username or email

**URL:** <https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609>\
**Category:** Get Help\
**Tags:** login\
**Created:** [November 2, 2022, 11:22pm UTC](https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609 "2022-11-02T23:22:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwarner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bwarner/32/40550_2.png) [@bwarner](https://community.auth0.com/u/bwarner)\
**Post date:** [November 2, 2022, 11:22pm UTC](https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609/1 "2022-11-02T23:22:15Z")

</div>

We currently are set up to utilize email as the login identifier and that works. We are expecting to roll out a new social component to our web app and would like to utilize the username field in order to not require users to make their email public. Is it possible to have the login page work with either email or username being typed into the identifier page:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/3/03f7482cf2789130361b86a4c8402f1d336e144e.png)

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [November 3, 2022, 1:12pm UTC](https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609/2 "2022-11-03T13:12:07Z")

</div>

Hi @bwarner

Yes this works: [Adding Username for Database Connections](https://auth0.com/docs/authenticate/database-connections/require-username)

However, I would suggest keeping email address as the identifier used for login, but adding a field “display user name” to your user record for displaying in your social component. Having a username AND an email is added complexity, it is there primarily for importing from legacy systems using username instead of email. Instead, keep it simple with just email, but let the user choose a display name for the social component.

John

---

<div class="post-metadata">

**Author:** ![bwarner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bwarner/32/40550_2.png) [@bwarner](https://community.auth0.com/u/bwarner)\
**Post date:** [November 3, 2022, 3:20pm UTC](https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609/3 "2022-11-03T15:20:16Z")

</div>

Thanks John, this is very helpful.

---

<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:** [November 18, 2024, 11:01pm UTC](https://community.auth0.com/t/login-identifier-as-either-username-or-email/93609/4 "2024-11-18T23:01:36Z")

</div>

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