# How to authenticate with username and password

**URL:** <https://community.auth0.com/t/how-to-authenticate-with-username-and-password/96624>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [December 16, 2022, 3:56pm UTC](https://community.auth0.com/t/how-to-authenticate-with-username-and-password/96624 "2022-12-16T15:56:34Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![david\_wisecarver](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david_wisecarver/32/37472_2.png) [@david\_wisecarver](https://community.auth0.com/u/david_wisecarver)\
**Post date:** [December 23, 2022, 11:21pm UTC](https://community.auth0.com/t/how-to-authenticate-with-username-and-password/96624/7 "2022-12-23T23:21:16Z")

</div>

Hi @anish.subedi,

If you are wanting to create new users with the `create` script, you will need to include a unique `email` for the user as well. If you have import mode off and Require Username enabled, the get\_user script will actually only use the `email`. We have a backlog item in to address that the get\_user script does not run again with a username, though we do not have an ETA for that at the moment. The workaround would be to use the `get_user` script to validate existing emails, but would only validate for existing username in the `create` script logic .

I also wanted to share this link to another community post that covers how your Custom DB scripts to be able to handle the `email` parameter being passed as either an email or a username: [Username does not work for custom mongodb connection](https://community.auth0.com/t/username-does-not-work-for-custom-mongodb-connection/57637)

---

_[View the full topic](https://community.auth0.com/t/how-to-authenticate-with-username-and-password/96624)._
