Hi. I have setup a working webapp to authenticate users with auth0 using Facebook and Google. Everything seem ok but the user_id is always missing or undefined in user profile, both in the webapp callback *(using passport-js) as well in the direct API call.
Please see it yourself:
@daniele I slightly redacted the access token (if you wish you can further redact it yourself or update the question/comment to not include it). Have in mind that editing it may still leave the original one in revisions history so next time consider not posting the real access token and just include the response you obtained (ideally after redacting any info you deem sensitive).
The user identifier should be included in the subclaim, if that claim is not present then ensure that you’re including openid as one of the scope values. If that is not the underlying issue more information may be required about client application settings used to obtain the access token for user information endpoint.
In this case it is safe to assume sub will contain a stable user identifier that uniquely identifies the user within the scope of the identity provider (the Auth0 service) as that it’s what the OIDC specification mandates. At this time, the sub claim is filled with the user_id information and is unlikely to change, but the most useful characteristics are the ones mandated by the spec; unique and stable (does not change across the lifetime of the end-user account).