# How will existing connection behave when we turn OFF "Require username"?

**URL:** <https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017>\
**Category:** Get Help\
**Tags:** username, database-connections\
**Created:** [January 11, 2021, 9:11pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017 "2021-01-11T21:11:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zblocker\_debtx](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/zblocker_debtx/32/14535_2.png) [@zblocker\_debtx](https://community.auth0.com/u/zblocker_debtx)\
**Post date:** [January 11, 2021, 9:11pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/1 "2021-01-11T21:11:33Z")

</div>

We have an existing database connection (Auth0-hosted with gradual migration enabled). For its whole existence we’ve had the “Require username” flag ON, and we have various rules based around username, etc.

What is going to happen if we turn off that flag for our connection? I have multiple questions.

- Will existing users be deleted or destabilized?
- Will existing users retain their `username` field in their profile?
- Will the username field automatically disappear from the Lock “Create” form?
- Will the language on the login form automatically change from “username/password” to something else?
- Can we (this is import for back-channel authentication) still submit a username through the Authentication API, instead of an email address, for some cases, and expect it to authenticate properly?

---

<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:** [January 12, 2021, 2:07pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/3 "2021-01-12T14:07:06Z")

</div>

Hi @zblocker_debtx

I don’t know the answer, but I suspect you cannot turn it off.  
It is easy enough to test: create a database, add a user with a username, then try to turn it off. I suspect it will say you can’t.

John

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 12, 2021, 2:09pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/4 "2021-01-12T14:09:05Z")

</div>

Hi @zblocker_debtx,

- Will existing users be deleted or destabilized?

No. The users will no longer have the option to log in with their username, but they can still log in with their email address. Nothing will change as far as the user’s data.

- Will existing users retain their `username` field in their profile?

Yes.

- Will the username field automatically disappear from the Lock “Create” form?

Yes.

- Will the language on the login form automatically change from “username/password” to something else?

Yes, here is an example (you can also [customize Universal Login](https://auth0.com/docs/universal-login/universal-login-page-customization))

 ![username:email](https://global.discourse-cdn.com/auth0/original/3X/2/4/241dade87248873d39d512bd552c54969aae265a.png) ![email:password](https://global.discourse-cdn.com/auth0/original/3X/c/4/c45a9f9dc3711738083f1c48f1c8fd882e3db2a6.png)

- Can we (this is import for back-channel authentication) still submit a username through the Authentication API, instead of an email address, for some cases, and expect it to authenticate properly?

It looks like the Password Grant will work for the Authentication API if you pass a username or an email with `requires_username` turned off.  
However, an error will be returned if you try to create a user with the Management API.

---

<div class="post-metadata">

**Author:** ![zblocker\_debtx](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/zblocker_debtx/32/14535_2.png) [@zblocker\_debtx](https://community.auth0.com/u/zblocker_debtx)\
**Post date:** [January 12, 2021, 2:29pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/5 "2021-01-12T14:29:16Z")

</div>

Hi Stephanie, just one follow-up on that last sentence:

> However, an error will be returned if you try to create a user with the Management API.

In which case would an error be returned: if we try to post a new user that has the `username` field set?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 12, 2021, 2:50pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/6 "2021-01-12T14:50:46Z")

</div>

Yes, that is correct. If the “Require username” flag is OFF then you cannot pass the `username` property in the Management API’s [create a user endpoint](https://auth0.com/docs/api/management/v2?_ga=2.201253737.674888892.1610366706-1595415333.1607347674#!/Users/post_users) request body.

It will return a 400:

```auto
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Cannot set username for connection without requires_username",
  "errorCode": "operation_not_supported"
}

```

---

<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:** [January 27, 2021, 2:50pm UTC](https://community.auth0.com/t/how-will-existing-connection-behave-when-we-turn-off-require-username/56017/7 "2021-01-27T14:50:49Z")

</div>

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