# Warning during login : "assigning context.idToken.user\_id is not supported"

**URL:** <https://community.auth0.com/t/warning-during-login-assigning-context-idtoken-user-id-is-not-supported/125064>\
**Category:** Get Help\
**Tags:** logs, management-api\
**Created:** [January 18, 2024, 5:30am UTC](https://community.auth0.com/t/warning-during-login-assigning-context-idtoken-user-id-is-not-supported/125064 "2024-01-18T05:30:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![datamatica.in](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/datamatica.in/32/12778_2.png) [@datamatica.in](https://community.auth0.com/u/datamatica.in)\
**Post date:** [January 18, 2024, 5:30am UTC](https://community.auth0.com/t/warning-during-login-assigning-context-idtoken-user-id-is-not-supported/125064/1 "2024-01-18T05:30:02Z")

</div>

As I monitor user logs, a warning during login catches my attention. The warning states:“assigning context.idToken.user\_id is not supported, use Account Linking feature or namespaced id token claims”. I’m having difficulty identifying the root cause of the issue. Please note that I haven’t implemented any rules or hooks.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 18, 2024, 9:21pm UTC](https://community.auth0.com/t/warning-during-login-assigning-context-idtoken-user-id-is-not-supported/125064/3 "2024-01-18T21:21:44Z")

</div>

Hi @datamatica.in,

The warning you’re experiencing indicates that a Rule you have enabled is assigning a value to `context.idToken.user_id`, which is not a supported action. I recommend checking your Rule pipeline to identify the rule responsible for this behavior.

If you intend to assign the `user_id` to the ID token, we recommend setting it as a namespaced custom claim using an Action. Here’s an example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'https://myapp.example.com';
  if (event.authorization) {
    // Set claims in ID token
    api.idToken.setCustomClaim(`${namespace}/user_id`, event.user.user_id);
  }
};

```

Let me know if you have any questions.

Thanks,  
Rueben

---

<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:** [February 1, 2024, 9:22pm UTC](https://community.auth0.com/t/warning-during-login-assigning-context-idtoken-user-id-is-not-supported/125064/4 "2024-02-01T21:22:08Z")

</div>

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