Closed antonydenyer closed 5 years ago
Upping this. I am following "The Complete Elixir and Phoenix Bootcamp" on Udemy and currently I can't proceed with the development, getting "Unable to access the user's email address" error with every attempt to log in. As my knowledge of Elixir is still very basic, I can't offer to fix this issue as yet. Edit: I temporarily fixed this by setting a public e-mail address in my Github profile, but I still think the authentication shouldn't break just because the user has no e-mail!
Added an option to fix the issue in #42
@moroz I also run into this issue while following "The Complete Elixir and Phoenix Bootcamp". I solved this by setting explicit default scopes in config.ex. Also I used the version 0.7 instead of the old 0.4 used in this guide.
config :ueberauth, Ueberauth,
providers: [
github: { Ueberauth.Strategy.Github, [default_scope: "user,public_repo"]}
]
@sbruhns That did not do the trick for me.
Make sure your Github email address is set to public (if it's private, you'll continue to see an error message).
I don't have control over what other people decide to set as public/private when they try to login to my site using their github login!
I don't have control over what other people decide to set as public/private when they try to login to my site using their github login!
@antonydenyer - Adding user:email
to @sbruhns suggestion above resolved this issue for me:
config :ueberauth, Ueberauth,
providers: [
github: { Ueberauth.Strategy.Github, [default_scope: "user,user:email,public_repo"]}
]
Note that the oauth page will specify you are asking for access to all their private email addresses.
I think this solution is helpful for the elixir bootcamp, but is too heavy handed for production apps.
Thanks @schtauffen are you creating a github app or an oauth app?
Thanks @schtauffen are you creating a github app or an oauth app?
I am just using github for oauth (following the elixir bootcamp guide).
just thanking @schtauffen and @sbruhns for saving my butt years later
I second the above ^ from feitelogram. Thank you guys. How did you figure that out though?
Got stuck here folks...did everything as @schtauffen and @sbruhns mentioned... any help? 😞
edit: giving up and using public email... (as much as i hate it)
edit 2: while creating the app, ensure that you choose email as read-only under User permissions
and default_scope: "user:email"
will be enough
config :ueberauth, Ueberauth,
providers: [
github: { Ueberauth.Strategy.Github, [default_scope: "user:email"]}
]
If you are using credentials for a github app you may not have access to the user's email address. Scopes are redundant as they are defined in your application settings as opposed to the oauth request.
identifying-users-on-your-site
What are the options we have here? Have an additional config setting to allow nil?