I am using Rails 3 + Devise 1.5 + OmniAuth via the omniauth-facebook gem to allow users to sign up for my app via Facebook.
I have everything working smoothly, except that once in a while, I have someone sign up for my app using Facebook, and the authentication hash doesn't contain the users email (although it includes many other attributes.) Again, most of the time I do get the email, but why is not included some of the time? Is there a way for a user to set his Facebook privacy settings in such a way that my app can obtain all sorts of info such as name, gender, and timezone, but not the email? I tried to make my own email in my Facebook profile private, but I was still able to log in to my app with Facebook.
Here's an example of a hash I received that's omitting the email (actual info censored):
"name"=>"XXXX XXXXXX", "first_name"=>"XXX", "last_name"=>"XXXXXX", "image"=>"http://graph.facebook.com/XXXXXXXXX/picture?type=square", "urls"=>{"Facebook"=>"http://www.facebook.com/XXXXXXXX"}}, "credentials"=>{"token"=>"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "expires_at"=>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"}}}
Thanks very much in advance!