Email field is missing inside ID token

I’m integrating Twitch OIDC authorization code flow but the resulting id token is missing the email field.

Here’s is the scope:

channel:read:stream_key user:read:email openid

This is the claims I’m requesting:

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

Here’s the resulting auth code URL:

And here is the content of ID token I get:

  "exp": 1685081168,
  "iat": 1685080268,
  "iss": "",
  "sub": "XXXXXXXXX",
  "email_verified": false,
  "picture": "",
  "preferred_username": "XXXXXXXXXX"

The resulting token has everything (incl. email_verified) but doesn’t have email field. Am I missing something?

I’ve also tried to hit /userinfo endpoint but the email field is missing there too.

   "email_verified": false 
   "exp": 1.685083754e+09 
   "iss": "" 
   "sub": "XXXXXXXXXXXX"

If the user hasn’t verified their email, it’s not going to be returned.

Thanks! Yea, already figured it out. Took me a while.
Might be worth to add a note about that to API documentation. Couldn’t find anything about it in there.

filed as OIDC email has to be verified to be returned by myinfo note · Issue #791 · twitchdev/issues · GitHub

1 Like

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