# Username Length and Hosted Login Page

**URL:** <https://community.auth0.com/t/username-length-and-hosted-login-page/8803>\
**Category:** Get Help\
**Tags:** username-password-co, hosted-login-page, username\
**Created:** [November 22, 2017, 6:35am UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803 "2017-11-22T06:35:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brianra/32/11261_2.png) [@brianra](https://community.auth0.com/u/brianra)\
**Post date:** [November 22, 2017, 6:35am UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/1 "2017-11-22T06:35:12Z")

</div>

On our Auth0 tenant we have username length configured to be 2-25 characters. This works fine when using the Lock on our own custom login page. However, on a hosted login page we are not able to enter more than 15 characters. We get an error stating: `Use 1-15 letters, numbers and "_"`.

How can we enter more than 15 characters for the username on a hosted Auth0 login page?

* * *

**Update** (as follow-up to @jmangelo answer):

The following screenshots show the configuration as well as the error I’m getting with long usernames on the hosted login page. Short usernames work just fine, and non-hosted login pages work just fine.

My guess is your attempt to authenticate through `/authorize` isn’t a sound reproduction attempt. We have other login pages that use the lock on our own custom web pages, and those do not have this problem. Only the hosted login page.

![alt text][1]  
![alt text][2]

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [November 22, 2017, 11:14pm UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/2 "2017-11-22T23:14:27Z")

</div>

I could not reproduce the issue in question; I updated a database connection to have the custom length requirements you mentioned and then proceeded to perform an authentication attempt through `/authorize` for a client application that had the previously mentioned connection as the only connection enabled. When trying to sign up it would fail only if entered more than 25 characters for username and the validation message would correctly state my custom requirements.

You should ensure that when you’re testing this in the hosted login page Lock is indeed using the expected connection. For example, if you have more than one database connection and you access the hosted login page for an application that uses a database connection with default settings for the username length then the error would be explained.

---

<div class="post-metadata">

**Author:** ![brianra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brianra/32/11261_2.png) [@brianra](https://community.auth0.com/u/brianra)\
**Post date:** [November 22, 2017, 11:24pm UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/3 "2017-11-22T23:24:31Z")

</div>

@jmangelo I do only have 1 database connection in my tenant. See the update to the question for more information.

---

<div class="post-metadata">

**Author:** ![brianra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brianra/32/11261_2.png) [@brianra](https://community.auth0.com/u/brianra)\
**Post date:** [December 5, 2017, 12:41am UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/4 "2017-12-05T00:41:04Z")

</div>

@jmangelo - are you able to reproduce what I’m seeing if you use a hosted login page (and not an api-based login)?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 5, 2017, 11:53pm UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/5 "2017-12-05T23:53:49Z")

</div>

@brianra missed your previous update; sorry about that. My tests were though the hosted login page (the `/authorize` call ends up redirecting to HLP). In the screenshot you mentioned the login color is not the default one so it seems you customized the HLP. In my tests I also used a customized HLP, but I used it while referencing the latest version of Lock. You should ensure that your HLP customization is also updated in terms of Lock versions as otherwise some features available only in latest version won’t be available.

---

<div class="post-metadata">

**Author:** ![brianra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brianra/32/11261_2.png) [@brianra](https://community.auth0.com/u/brianra)\
**Post date:** [November 22, 2017, 11:24pm UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/6 "2017-11-22T23:24:31Z")

</div>

@jmangelo I do only have 1 database connection in my tenant. See the update to the question for more information.

---

<div class="post-metadata">

**Author:** ![brianra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brianra/32/11261_2.png) [@brianra](https://community.auth0.com/u/brianra)\
**Post date:** [February 16, 2018, 7:04am UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/7 "2018-02-16T07:04:15Z")

</div>

Hi @jmangelo - I’m just getting back to this. I did have Lock 10.x in my hosted login page. I just upgraded it to 11.x and I can now use longer usernames, which is great. Thanks!

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/username-length-and-hosted-login-page/8803/8 "2018-03-02T05:57:30Z")

</div>


