In some situations the GitHub oauth2 API does not return the user email in the access_token
response.
One such situation is if a user has chosen to set the email visibilty to Don't show my email address
in the
https://github.com/settings/profile
page.
To ensure you get the primary email value populated in your internal User model. It is necessary to call a service in the GitHub API to fetch the value.
The URL is: https://api.github.com/user/emails?access_token=<the_access_token_from_authentication>