Auth0 Home Blog Docs

No ".sub" in silentAuthentication



I didn’t expect this behaviour:
When I use passworldess_login to get a token and then use the accessToken to get user info auth0.webAuth.client.userInfo, I get:

Object {sub: "sms|574dfae283c90a8a88889fbd", name: "XXX", nickname: "XXX", picture: "XXX", updated_at: "2017-06-30T18:07:12.768Z"}

When I use silentAuthentication refreshed accessToken in the same userInfo call, I get:

Object {name: "XXX", nickname: "XXX", picture: "XXX", updated_at: "2017-06-30T18:07:12.768Z"}

No sub information.
I need sub, how do I fix this?


@jmangelo do you have any idea?


Can you confirm whether you are requesting the openid scope?


Yes, I believe I do:
renewAuth call:
audience: https://${domain}/userinfo,
scope: ‘openid profile offline_access’,
prompt: ‘none’,
redirectUri: window.location.origin + ‘/callback.html’,
responseType: ‘token id_token’,
usePostMessage: true
}, (err, result) => {


So sorry. Actually, I thought the openid was there, but I was seeing the code in my branch and not the one that eventually went in production.
That was it.


@prashant solved the problem. It was missing ‘openid’ scope.