Cannot obtain github user email via ueberauth, scopes empty

The documentation is clear on how to set scopes, but github returns a 403 when attempting to access rest apis that I have requested scope for.

Moreover, when I inspect the Ueberauth object, the scopes property is empty.

I am using Ueberauth + the Github strategy, configured with:

github: {Ueberauth.Strategy.Github, [default_scope: "user,user:email"]}

But no such scopes are being set.

Thoughts?

The actual auth request is successful, and I get everything BUT the user email back (which is expected from github). However, using the provided access token can NOT obtain the email. The scopes on the credential object are empty, and efforts to use the access token to obtain email (as specified in github docs) returns the 403.

Note I see other sites immediately obtaining the email on github authentication, so I know this is possible, and stack overflow threads also point to this as the correct mechanism.

I have:

config :ueberauth, Ueberauth,
  providers: [
    github: {Ueberauth.Strategy.Github, [default_scope: "user:email"]},
    google: {Ueberauth.Strategy.Google, [default_scope: "email"]},
    microsoft: {Ueberauth.Strategy.Microsoft, []},
    wordpress: {Ueberauth.Strategy.Wordpress, [default_scope: "auth"]},
    discord: {Ueberauth.Strategy.Discord, [default_scope: "identify email"]}
  ]

Haven’t touch this part for more than a year; it is still working.

3 Likes