title: Facebook login callback hash documentation
body: <p>I'm using Omniauth with Devise to authenticate users via Facebook for a web app I'm writing using Rails 3.0.4  </p>
  
  <p>I modeled it after Ryan Bates' Railscasts:</p>
  
  <p><a href="http://railscasts.com/episodes/235-omniauth-part-1" rel="nofollow">http://railscasts.com/episodes/235-omniauth-part-1</a><br>
  <a href="http://railscasts.com/episodes/236-omniauth-part-2" rel="nofollow">http://railscasts.com/episodes/236-omniauth-part-2</a></p>
  
  <p>At this point, I can log into my site with my Facebook account and pull my email out of the callback hash, which looks like this for me:</p>
  
  <pre><code>request.env["omniauth.auth"]  
  
  {"user_info"=&gt;  
    {"name"=&gt;"Eric Hu",  
     "urls"=&gt;  
      {"Facebook"=&gt;"http://www.facebook.com/...", "Website"=&gt;nil},  
     "nickname"=&gt;"...",  
     "last_name"=&gt;"Hu",  
     "first_name"=&gt;"Eric"},  
   "uid"=&gt;"...",  
   "credentials"=&gt;  
    {"token"=&gt; "..."},  
   "extra"=&gt;  
    {"user_hash"=&gt;  
      {"name"=&gt;"Eric Hu",  
       "timezone"=&gt;-8,  
       "gender"=&gt;"male",  
       "id"=&gt;"...",  
       "last_name"=&gt;"Hu",  
       "updated_time"=&gt;"2011-02-21T17:46:19+0000",  
       "verified"=&gt;true,  
       "locale"=&gt;"en_US",  
       "link"=&gt;"http://www.facebook.com/...",  
       "email"=&gt;"...",  
       "first_name"=&gt;"Eric"}},  
   "provider"=&gt;"facebook"}  
  
  (replaced some fields with "..." for my own privacy)
  </code></pre>
  
  <p>Right now, I use this field to get the user's email address </p>
  
  <pre><code> request.env["omniauth.auth"]["user_info"]["extra"]["email"]
  </code></pre>
  
  <p>I don't know if the callback hash varies with the user's settings--I've actually restricted my email display settings on Facebook and it still shows up.  To make sure my code handles any possible variations with this hash, I'd like to find some reference on how this Facebook login callback hash looks and how it can vary.  So far I haven't found anything on SO or the Facebook developer documentation.</p>
  
  <p>The question: is there an official reference for the Facebook login callback hash?  I don't want to assume that all the same hash elements are there for all users.  I included as much info as I could here for other people who want to authenticate their rails apps using Facebook and Omniauth.</p>