I use Rails 3 + Devise 1.5 + OmniAuth through the omniauth-facebook gem so that users can register for my application via Facebook.
I have everything that runs smoothly, except from time to time I have someone who signs up for my application using Facebook, and the authentication hash code does not contain the users email address (although it includes myself a lot of other attributes.) Again, most when I receive an email, but why is it not included for a while? Is there a way to set Facebook’s user privacy settings so that my application can receive all kinds of data, such as name, gender and time zone, but not an email address? I tried to make my own email address on my Facebook profile private, but I could still log in to my application with Facebook.
Here is an example of a hash that I got about omitting an email address (actual information with censorship):
"name" => "XXXX XXXXXX", "first_name" => "XXX", "last_name" => "XXXXXX", "image" => "http://graph.facebook.com/XXXXXXXXXX/picture? Type = square "" URL "=> {" => "http://www.facebook.com/XXXXXXXX Facebook"}}, "powers" => { "marker" => "", "expires_at XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" => 1329364800, "expires" => true}, "extra" => {"raw_info" => {"id" => "XXXXXXXX", "name" => "XXXX XXXXXX", "first_name" => "XXXX", "last_name "=>" XXXXXX "," link "=>" http://www.facebook.com/XXXXXXXXX "," username "=>" XXXXXXXXX "," gender "=>" female "," timezone "=> - 5, "locale" => "en_US", "verified" => true, "updated_time" => "2012-02-15T00: 01: 23 + 0000"}}}
Thank you very much in advance!
source share