Auth0 Home Blog Docs

/userinfo not returning profile information, even with correct scopes



The /userinfo endpoint is not returning any profile information even after I’ve included the openid profile email scopes into my instance of the Auth class.

auth0 = new auth0.WebAuth({
    domain: '',
    clientID: CLIENT_ID',
    redirectUri: 'http://localhost:3000/login-callback',
    audience: '',
    responseType: 'token id_token',
    scope: 'openid profile email'

In fact, all I get in the response is the sub attribute. Why is this?


I could not reproduce this situation with a similar configuration to yours and then calling either authorize or client.login methods to obtain the access token that I would then use to call /userinfo.

Verify that your code is not overriding, when calling one of the methods above, the scope set when you create the WebAuth instance. You can also make sure that any request is indeed being made with the correct set of scopes using the browser network tools to analyse the applicable request made to the Auth0 tenant.


Annoyingly, but fortunately, it started working. I spent a few hours refactoring my Auth service to try to figure it out, to no avail. After spending a few days away from the code, and trying it again tonight (without any updates to the code at all), the response is coming back as I would expect. Really, really bizarre. I’ll file this incident alongside any other inexplicable bug that was somehow fixed. Thanks for your time and attention!