# Set email and name after initial login/user creation

**URL:** <https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 10, 2025, 12:54pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807 "2025-06-10T12:54:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 10, 2025, 12:54pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/1 "2025-06-10T12:54:29Z")

</div>

I need to be able to set both name and email after initial user creation / login. The OIDC provider I use only has a unique identifier for the users, but no name or email address.

I have created a post login form where I want the users to type in their name and email adress. I am able to add the information to the user\_metadata property, but when trying to store it directly on the user in the “name” and “email” properties nothing happens. Flow is executed without any errors..

Anyone know if this is possible?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 10, 2025, 3:22pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/3 "2025-06-10T15:22:26Z")

</div>

Hi @eff

Welcome to the Auth0 Community!

I will be testing this in the meantime on my end and will come back with some updates. Otherwise, could you please let me know how do you set those properties inside the `Forms Flow` that you are using?

Also, are these properties available under the user in the Dashboard after the login is complete?

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 10, 2025, 4:10pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/4 "2025-06-10T16:10:25Z")

</div>

Hi again!

As far as I have tested, it appears that when I am setting the values inside the `email` and `name` properties directly, both of them get populated accordingly as seen below:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/4/14ab198e823d8a7ae5e1515c145beda5271e9f6b.png)

It appears that the email property might not be passed to the ID Token because it is not an available attribute inside the database connection you are using, however, it is set inside the Dashboard. I would recommend to add the email attribute as well so that users can create an account using an username and email or you can add the email as a custom claim inside an action:

```auto
const namespace = 'user_email'
api.idToken.setCustomClaim(namespace, event.user.email);

```

Let me know if oyu have any other questions!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 10, 2025, 7:34pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/5 "2025-06-10T19:34:48Z")

</div>

Hi. I checked the user in the dashboard and it did not have any of my information.

I tried like this:  
{  
“name”: “{{fields.full\_name}}”,  
“email”: “{{fields.email}}”  
}

This worked:

```auto
{
  "user_metadata": {
    "name": "{{fields.full_name}}",
    "email": "{{fields.email}}"
  }
}

```

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 10, 2025, 7:40pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/6 "2025-06-10T19:40:20Z")

</div>

This is the flow I have used and I was able to sign up a user successfully with the information inside the form:

```auto
{
  "name": "{{fields.name}}",
  "email": "{{fields.email}}"
}

```

And this is the user JSON available in the Dashboard:

```auto
"name": "John Travolta",
    "nickname": "data_test",
    "picture": "https://cdn.auth0.com/avatars/da.png",
    "updated_at": "2025-06-10T15:31:20.394Z",
    "user_id": "auth0|{{user_id}}",
    "username": "data_test",
    "email": "data_test@test.com",
    "email_verified": false

```

I would advise to double check the names of steps inside the form to make sure the data is retrieved from the right place.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 11, 2025, 6:39am UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/7 "2025-06-11T06:39:48Z")

</div>

Was this done through OIDC integration, and part of the post-login trigger?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 11, 2025, 2:37pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/8 "2025-06-11T14:37:54Z")

</div>

Oh, sorry, I must have missed the part where you stated that this is done through an OIDC connection. However, the results should be the same since the profile attributes should be the same inside an user who signed up through your application normally or retrieved through an IdP.

I will double check the results using different OIDC connections and provide you with an update nonetheless!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 11, 2025, 3:20pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/9 "2025-06-11T15:20:34Z")

</div>

Hi again,

After some testing, it appears that the retrieved user profile cannot be modified through Auth0 directly. In order for the Management API to be able to modify user data, they would need to be stored via a Database Connection or Passwordless connection.

In order for your to update the user with such information, you either need to add these elements as `user_metadata` as you have attempted above or you would need to make an API call to the IdP in order to add these attributes to their profile so that they are retrieved after login (if the IdP can support them).

Sorry for the confusion created on this matter.

If you have any other questions, let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 11, 2025, 4:43pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/10 "2025-06-11T16:43:51Z")

</div>

We need a manual flow where the user inputs this information. The IdP does not provide this information, and will not do it either. There isn’t any APIs either. The problem with this is that the user list becomes completely useless as it just says “(empty) (empty)” on all the users.

Are there any other workarounds, or is this something that can be fixed?

---

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 11, 2025, 7:22pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/11 "2025-06-11T19:22:37Z")

</div>

I actually got it working! I had to change the sync frequency on the enterprise OIDC connection to “Only at first login”. This allows you to edit the root properties of the users 🥳

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 11, 2025, 8:17pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/12 "2025-06-11T20:17:38Z")

</div>

Thanks for letting us know!

I believe I must have missed that somehow when testing 😅.

If you have any other issues, feel free to always let us know by posting on the community!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![eff](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eff/32/60877_2.png) [@eff](https://community.auth0.com/u/eff)\
**Post date:** [June 17, 2025, 12:07pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/13 "2025-06-17T12:07:56Z")

</div>

Hi @nik.baleca

Some further testing at my end. I am now able to update the root name property of the user on login, but if I try updating the email property it looks like the login is successful, but none of the properties are updated.

So, if I add email in the json, both name and email fails. No error logs or nothing. As soon as I remove email from the fields to be updated it starts working again. The name is changed.

Based on the documentation it should be possible to change the email property, even if using a OIDC connection, as it specifies to include the connection property if that is the case. [https://auth0.com/docs/api/management/v2/users/patch-users-by-id](https://auth0.com/docs/api/management/v2/users/patch-users-by-id)

Do you have any suggestions on how I can achieve this? One observation is that when I inspect the raw JSON of the user there is no email property at all. Neither in the root, or in the identities node.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 18, 2025, 4:18pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/14 "2025-06-18T16:18:10Z")

</div>

Hi again!

Some root attributes provisioned through connections such as Social or Enterprise connections cannot be updated using the Management API. When trying to so do, you will most likely receive an error which states “operation not supported”.

The documentation states that when updating the properties for a _secondary identity_, meaning that the user has multiple identities created within the tenant, the `connection` parameter is required. However, that is not the case for the connections specified above whose root attributes are handled and provisioned by the IdP. In that case, they would need to be updated by the IdP.

As you have mentioned above, the update most likely fails when including both the `email` and `name` properties because the operation fails when trying to update the `email`. Otherwise, I would recommend going with the initial approach, where this information would be stored under `user_metadata`.

Kind Regards,  
Nik

---

<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:** [July 2, 2025, 4:18pm UTC](https://community.auth0.com/t/set-email-and-name-after-initial-login-user-creation/187807/15 "2025-07-02T16:18:51Z")

</div>

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