# Idpuser.email contains no value for Github IdP

**URL:** <https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265>\
**Category:** OAuth/OIDC\
**Created:** [May 8, 2026, 10:02pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265 "2026-05-08T22:02:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iling\_exiger](https://avatars.discourse-cdn.com/v4/letter/i/dbc845/32.png) [@iling\_exiger](https://devforum.okta.com/u/iling_exiger)\
**Post date:** [May 8, 2026, 10:02pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265/1 "2026-05-08T22:02:17Z")

</div>

After setting up Github as an IdP, I am not receiving the user’s email address from Github, despite requesting the user:email scope.

Per the Github IdP documentation ([Social Login | Okta Developer](https://developer.okta.com/docs/guides/social-login/github/main/#handle-users-without-email-addresses)) I am setting the username to:

`idpuser.email == null ? idpuser.externalId + '@github.example.com' : idpuser.email`

Also per the docs, I am mapping the Okta user’s email field to:

`appuser.email == null ? appuser.externalId + '@github.example.com' : appuser.email`

Both of these end up being e.g. [123456@github.example.com](mailto:123456@github.example.com)

Is there a way I could see all of the fields available in `idpuser` or `appuser`? Maybe there is a different one I should use?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [May 8, 2026, 10:09pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265/2 "2026-05-08T22:09:57Z")

</div>

Our [documentation](https://developer.okta.com/docs/guides/social-login/github/main/#handle-users-without-email-addresses) mentions that not all users will have an actual email sent in the email claim, which is why the expression from our documentation can be used to construct a placeholder email.

> GitHub doesn’t always provide email addresses for users that it authenticates, such as when the GitHub setting **Keep email addresses private** is enabled. However, Okta requires an email address for its users to be able to sign in. You can support users who don’t have email addresses by using information from GitHub to generate email addresses for them.

If you’re testing with your own Github account, you should be able to confirm if you have this setting turned on yourself under Settings → Emails

 ![Screenshot 2026-05-08 at 3.08.27 PM](https://global.discourse-cdn.com/oktadev/original/2X/2/2c557164435d2a45dec13dd2334e9e2261bafd71.png)

---

<div class="post-metadata">

**Author:** ![iling\_exiger](https://avatars.discourse-cdn.com/v4/letter/i/dbc845/32.png) [@iling\_exiger](https://devforum.okta.com/u/iling_exiger)\
**Post date:** [May 8, 2026, 10:12pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265/3 "2026-05-08T22:12:25Z")

</div>

In spite of that setting, it is possible to retrieve a user’s email address via the Github API, using the Github OAuth token that Okta would have access to during the OAuth flow. In other words, the only reason this field would be empty in the end is because Okta is not making a Github API request that specifically retrieves it.

edit: example [https://stackoverflow.com/a/69825519](https://stackoverflow.com/a/69825519)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [May 12, 2026, 5:21pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265/4 "2026-05-12T17:21:09Z")

</div>

The only requests Okta will make to Github are to request the tokens and to read the user’s profile information. If their email information _is_ available, but at a different endpoint, I don’t see evidence that we have designed our implementation to call it

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [June 11, 2026, 5:21pm UTC](https://devforum.okta.com/t/idpuser-email-contains-no-value-for-github-idp/35265/5 "2026-06-11T17:21:53Z")

</div>

Closed on June 11, 2026, 5:21pm UTC

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