Email not returning from user profile

I saw on a thread here that you should be able to return email from OAuth2Strategy doesnt provide email in user profile - #5 by BarryCarlyon

I’m using this as Helix isn’t working for us + I’ve been going through the OIDC docs and it looks like what we need: Using OIDC to get OAuth Access Tokens | Twitch Developers

Authorization URL looks like:{userinfo:{email:null,email_verified:null,picture:null,preferred_username:null}

Token URL:

Scopes: ‘user:read:email’, ‘openid’

It looks like the rest of the profile is returned, other than email (+ is there a unique twitch ID I can return as well?). Otherwise, this is pretty much what gets returned:

{"aud": "xxx", "azp": "xxx", "exp": xxx, "iat": xxx, "iss": "", "sub": "xxx", "preferred_username": "xxx"}


You did call userinfo as documented here Using OIDC to get OAuth Access Tokens | Twitch Developers ?

You didn’t get picture back either which suggest something is awry.

Here yoru claims lack " so this suggests your Claism are not JSON encoded correctly, and URI encoded

it should be more like,%22email_verified%22:null,%22picture%22:null,%22preferred_username%22:null%7D%7D

Which’ll display something like (it might display like this even with invalid claims)

Thanks!, I fixed it - had it in

"id_token": {
    "email": null,
    "email_verified": null
  "userinfo": {
    "picture": null

instead of

"userinfo": {
    "picture": null,
    "email": null

Regarding the other fields there (e.g. aud, azp, exp), are any one of them a unique ID I can refer to the user as?

That would be the sub key

That sub key is the users unique Twitch User ID

Amazing, thank you!

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