Missing user_id from user profile

Hi there,

I have a .NET MVC app that is authenticating users via Auth0. However, when I get the token back from Auth0 and query the user profile it doesn’t include the user_id property. I am sending openid to auth0 as one thread suggested but still no luck.
Any ideas?

does it include the sub property?

Yes, it does. Is it the same? If so can I rely on it always being there?

Yes.

Note that the user_id property is sent as sub in the ID Token, and that favorite_color and user_metadata are not present in the OIDC response from Auth0. This is because OIDC does not define standard claims to represent all the information in this user’s profile. We can, however, define a non-standard claim by namespacing it through a rule:

1 Like

Thanks for the clarification. I was asking because we have a client with Auth0 and with theirs user_id is coming back. But will use sub from now on.
Thank you.

It depends on the type of your client, actually. If your client is configured as an OIDC client, then it will be sub. If it’s not an OIDC client, it will return as user_id

Sorry, maybe I didn’t make myself clear. I meant we have a customer that is using our software and they get the user_id as well as sub. That’s using the exact same code just different domains of auth0.

Maybe they’re adding user_id as part of a rule? That’s an idea… But it’s better to rely on the OIDC spec and use sub :tada:

Okay, thanks you. Will check with them.
Many thanks for your help!