# How to use username authentication (registration) instead of email?

**URL:** <https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674>\
**Category:** Game Design\
**Tags:** server-framework, authentication\
**Created:** [May 28, 2021, 7:20am UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674 "2021-05-28T07:20:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoursTruly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/yourstruly/32/512_2.png) [@YoursTruly](https://forum.heroiclabs.com/u/YoursTruly)\
**Post date:** [May 28, 2021, 7:20am UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/1 "2021-05-28T07:20:34Z")

</div>

Hello There,  
Is it possible to create an user account via Username and password only instead of email and password?  
We tried to do it using email authentication by sending username and password parameter but its not allowing.

Thanks

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [June 2, 2021, 1:49am UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/2 "2021-06-02T01:49:21Z")

</div>

@YoursTruly you can create a before or after hook for `AuthenticateCustom` in the server framework and then call the client `AuthenticateCustom` method and pass password through the `vars` parameter.

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [June 2, 2021, 10:19pm UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/3 "2021-06-02T22:19:43Z")

</div>

@YoursTruly We validate emails so the sign-in is always done against the email address as input. I can see a use case to allow sign-in via username and password though. Can you open a feature request for it?

---

<div class="post-metadata">

**Author:** ![YoursTruly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/yourstruly/32/512_2.png) [@YoursTruly](https://forum.heroiclabs.com/u/YoursTruly)\
**Post date:** [June 3, 2021, 5:14am UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/4 "2021-06-03T05:14:33Z")

</div>

@novabyte Feature request created on Github.

@lugehorsam Can you please provide a bit more information how to do it via AuthenticateCustom in the server framework? Issue is with registration/sign up , for Sign In it works fine with username and password

Thanks

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [June 3, 2021, 9:46am UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/5 "2021-06-03T09:46:17Z")

</div>

@YoursTruly The suggestion that @lugehorsam made is if you want to handle your own email-based authentication service which can do username based sign-in. That way you can bind those user accounts to Nakama through custom authentication but control the accounts system yourself.

I saw the feature request you opened and we’ll see how best to add it to the next set of engineering tasks.

---

<div class="post-metadata">

**Author:** ![YoursTruly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/yourstruly/32/512_2.png) [@YoursTruly](https://forum.heroiclabs.com/u/YoursTruly)\
**Post date:** [June 3, 2021, 12:16pm UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/6 "2021-06-03T12:16:59Z")

</div>

Thank you @novabyte noted on it.

---

<div class="post-metadata">

**Author:** ![MWFIAE](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mwfiae/32/678_2.png) [@MWFIAE](https://forum.heroiclabs.com/u/MWFIAE)\
**Post date:** [June 4, 2021, 9:01pm UTC](https://forum.heroiclabs.com/t/how-to-use-username-authentication-registration-instead-of-email/1674/7 "2021-06-04T21:01:52Z")

</div>

As a workaround you could just make it an email address by appending @example.com or @.com to the username.  
Might still impose some restriction on the username though
