-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default info_fields to 'name,email' #209
Conversation
I'm ok with this. @mkdynamic can you confirm? |
@simi +1. Looks good to merge with me. |
@blueplanet can you please add change to README.md with defaults and add changelog record? |
@simi @mkdynamic Thank you for review! 👍 |
Fix default info_fields to 'name,email'
❤️ |
New release today? |
New release, please? |
new release is really needed... I cannot use gem without it - I cannot get Email without it... |
You can reference the needed commit in your Gemfile. |
It's not returning info.verified or info.verified_email though, so you can't be sure that is really there email.. how do you get the verified flags? |
@peterept are you sure a user can "login with facebook" at all without having verified his FB email first? I remember doing that check a few days ago - an unconfirmed FB account cannot connect with any API-consuming app. |
Hi @vemv is that documented somewhere? What worked for me was to explicitly request the verified field:
|
@vemv here's an update after some experimenting (Facebook v2.5):
So we can not rely on getting an email field. |
@peterept nice one, much appreciated! So verified_email cannot be ignored. Do you think omniauth-facebook needs any change? Personally I don't. Maybe these details could be explained in a FAQ so one doesn't have to figure out stuff. |
Actually facebook don't support verified_email field either; they only support the verified flag (which is true if you verified by an email, but also true if you only verified with a phone number and no email). https://developers.facebook.com/docs/graph-api/reference/user In my account verified by phone, I added an email and did not verify it. The oauth data is the same - no email. So technically, for facebook, if the email field is present then the email has been verified, otherwise the verified flag tells you if the account is verified by several ways (which may or may not be email). I'm not sure about ominiauth-facebook, maybe it should add the verified_email if there is an email address. Or should omniauth itself handle it? |
I had a similar problem on a project where they implemented oauth following this article: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ The problem with the above implementation is that they expected facebook to return a Since facebook doesn't return the I know this problem is not actually related to |
Still having problems getting user email
omniauth_callbacks_controller.rb
user model
|
So, you can try |
@blueplanet sorry for the rookie mistake. |
@simi @blueplanet This breaks the code. I don't receive default fields anymore: # (#<OmniAuth::Strategies::Facebook:0x007fbe6bd19d00>):1[21]
> raw_info.keys
=> ["name", "email", "id"]
# def raw_info
# @raw_info ||= access_token.get('me', info_options).parsed || {}
# end
> access_token.get('me', info_options.tap { |x| x[:params].delete(:fields) }).parsed.keys
["id",
"email",
"first_name",
"gender",
"last_name",
"link",
"locale",
"name",
"timezone",
"updated_time",
"verified"] Does everybody like current default behaviour? UPD For everybody who still wants whole public_profile: configure with |
Problem
Version 2.4, default not include the email field.
https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/
The default values for 'omni_auth.auth' only
name
andid
field.After
If set the
fields
to only'email'
, the value of fieldname
be set to the email value. So setfields
to'name,email'
.