# Using "username" in the context of a "custom database"

**URL:** <https://community.auth0.com/t/using-username-in-the-context-of-a-custom-database/96207>\
**Category:** Get Help\
**Tags:** automatic-migration, user-management\
**Created:** [December 11, 2022, 6:35pm UTC](https://community.auth0.com/t/using-username-in-the-context-of-a-custom-database/96207 "2022-12-11T18:35:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 15, 2022, 11:06pm UTC](https://community.auth0.com/t/using-username-in-the-context-of-a-custom-database/96207/3 "2022-12-15T23:06:04Z")

</div>

Hi @connectionreset,

Welcome to Auth0 Community!

If you have `Requires Username` enabled for a custom database connection, you will need to then add the the `username` property to the [Login](https://auth0.com/docs/authenticate/database-connections/custom-db/templates/login) and [Get User](https://auth0.com/docs/authenticate/database-connections/custom-db/templates/get-user) scripts.

> **[Custom Database Action Script Execution Best Practices](https://auth0.com/docs/authenticate/database-connections/custom-db/custom-database-connections-scripts/execution#create-action-scripts)**
>
> Learn about best practices for custom database action script execution.

You should see an error message “DB Login Custom script: username is required” if you have it missing from these scripts when `Requires Username` is enabled.

Hope this helps!

Thanks,  
Dave

---

_[View the full topic](https://community.auth0.com/t/using-username-in-the-context-of-a-custom-database/96207)._
