# Hiro in Unity with Email Authentication workflow

**URL:** <https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193>\
**Category:** Hiro\
**Tags:** authentication\
**Created:** [May 7, 2025, 10:32am UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193 "2025-05-07T10:32:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kroonhorstdino](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kroonhorstdino](https://forum.heroiclabs.com/u/kroonhorstdino)\
**Post date:** [May 7, 2025, 10:32am UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193/1 "2025-05-07T10:32:06Z")

</div>

Hello,

are there any sample for Hiro + Unity using the email based authentication workflow? The default sample for Unity uses the Device Authentication.  
When I try to use `Client.AuthenticateEmailAsync`, neither session or account are set in the `NakamaSystem` and neither is the authorizer function called. Am I missing a crucial step?

---

<div class="post-metadata">

**Author:** ![HeroicNathan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/heroicnathan/32/2151_2.png) [@HeroicNathan](https://forum.heroiclabs.com/u/HeroicNathan)\
**Post date:** [May 15, 2025, 2:45pm UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193/2 "2025-05-15T14:45:16Z")

</div>

Heya!

Just to clarify, have you tested the Hiro + Unity device authentication first to see if that works? Or did you start with email based?

Best,  
Nathan

---

<div class="post-metadata">

**Author:** ![kroonhorstdino](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kroonhorstdino](https://forum.heroiclabs.com/u/kroonhorstdino)\
**Post date:** [May 22, 2025, 8:31am UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193/3 "2025-05-22T08:31:15Z")

</div>

Hi,

I started with email authentication as this was the previous worfklow from the pure nakama implementation.  
I will test hiro with the device authentication to see if that works 👌

---

<div class="post-metadata">

**Author:** ![kroonhorstdino](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kroonhorstdino](https://forum.heroiclabs.com/u/kroonhorstdino)\
**Post date:** [June 2, 2025, 2:49pm UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193/4 "2025-06-02T14:49:35Z")

</div>

Hello,

device authentication worked and I think I understand the workflow better now.  
But there is one issue: Is there a simple way to provide the email, username, password to the Authorizer function? Could you provide me an example for a email authentication based workflow for the NakamaSystem?  
I would really appreciate it.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 4, 2025, 2:09pm UTC](https://forum.heroiclabs.com/t/hiro-in-unity-with-email-authentication-workflow/6193/5 "2025-06-04T14:09:10Z")

</div>

Hello @kroonhorstdino,

I believe all you’d need to do is follow the example here: [Initializing the NakamaSystem - Heroic Labs Documentation](https://heroiclabs.com/docs/hiro/unity/getting-started/nakama-system/#configuration), but instead of using the deviceId, you’d grab the user’s Username and Password and then run `client.AuthenticateEmailAsync` instead of `client.AuthenticateDeviceAsync`.
