# Disable username from username-password authentication

**URL:** <https://community.auth0.com/t/disable-username-from-username-password-authentication/110266>\
**Category:** Get Help\
**Tags:** regular-database-connections, connections\
**Created:** [June 29, 2023, 12:08pm UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266 "2023-06-29T12:08:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezequiel.sandoval](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ezequiel.sandoval/32/64613_2.png) [@ezequiel.sandoval](https://community.auth0.com/u/ezequiel.sandoval)\
**Post date:** [June 29, 2023, 12:08pm UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266/1 "2023-06-29T12:08:01Z")

</div>

Hello community!

At the moment we have the current solution:

- regular database connection that requires username for signup
- login with username or email attr

We are planning to:

- Disable authentication for username attr and leave only email as valid attr for login

what would be the best approach to achieve this? I can not find a clear way to do it on docs/community old post

In addition:

- Is it possible to know during post-login actions if the user logged in with username or email for authentication?

Thanks in advance!!!

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [June 29, 2023, 4:58pm UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266/2 "2023-06-29T16:58:15Z")

</div>

Hello @ezequiel.sandoval,

Welcome to the Community! I’m not sure if this answers your question but if you disable usernames, users who already had a username can continue to log in with their username.

Mark

---

<div class="post-metadata">

**Author:** ![ezequiel.sandoval](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ezequiel.sandoval/32/64613_2.png) [@ezequiel.sandoval](https://community.auth0.com/u/ezequiel.sandoval)\
**Post date:** [June 30, 2023, 6:43am UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266/3 "2023-06-30T06:43:39Z")

</div>

Yes, I tried that approach and i saw that behaviour, so, in order to “remove” username login we should disable this and also delete that attribute from users entries?

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [July 4, 2023, 11:35am UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266/4 "2023-07-04T11:35:09Z")

</div>

I would say yes but I’m not sure you can delete the username with the API in its current state. If you manage to do so, please let me know!

---

<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:** [July 18, 2023, 11:35am UTC](https://community.auth0.com/t/disable-username-from-username-password-authentication/110266/5 "2023-07-18T11:35:54Z")

</div>

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