title: Facebook Omniauth hash not returning info_fields
body: <p>I've been working with the Facebook Omniauth and Devise but have run into an issue where the returned hash does not contain any of the information I'm requesting in my info fields. I'm just trying to get Facebook to return the first and last names with the email if it's available separately so I can create new users with that information. I don't think I need to set up specific permissions with Facebook to return these fields (as you do with some info_fields that require verification).</p>
  
  <p>I am using Rails 4.2.6.
  This is the returned hash:</p>
  
  <pre><code>#&lt;OmniAuth::AuthHash credentials=#&lt;OmniAuth::AuthHash 
  expires=true expires_at=1486542909 
  token="EAAXYor9I0XgBADbIaZC99Lu0xGAdVVSXSyZC1TsZCHcZCi0kiWPdZCHA0DsLait7zn1cSpEsbc1mViWvFxZAPraz2Hdyfyn2pfonpeDlhP6Nqv7RiGNpDQ1Bxxm81LHwoPHMIbag95pksGZChcQ7YMrk8eUuQNkgScZD"&gt; 
  extra=#&lt;OmniAuth::AuthHash 
  raw_info=#&lt;OmniAuth::AuthHash id="xxxxxxxxxx" name="xxxxxxxx"&gt;&gt;
  info=#&lt;OmniAuth::AuthHash::InfoHash 
  image="http://graph.facebook.com/xxxxxxxxxx/picture?type=square" 
  name="xxxxxxxxxx"&gt; 
  provider="facebook" 
  uid="xxxxxxxxxx"&gt;
  </code></pre>
  
  <p>Most of the solutions for similar questions have involved something in devise.rb, which looks like this for me:</p>
  
  <pre><code>config.omniauth :facebook, "xxxIDxxx", "xxxSECRETxxx", scope: 'email,public_profile', info_fields: 'email, first_name, last_name'
  </code></pre>
  
  <p>My CallBacksController:</p>
  
  <pre><code>class CallbacksController &lt; Devise::OmniauthCallbacksController
  
  def all
      @user = User.from_omniauth(request.env["omniauth.auth"])
      @request = request.env["omniauth.auth"]
  
      if @user.persisted?
          flash.notice = "You have successfully signed in!"
          sign_in_and_redirect @user
      else
          session["devise.user_attributes"] = @user.attributes
          redirect_to new_user_registration_path      
      end
  end
  
  alias_method :facebook, :all
  end
  </code></pre>
  
  <p>My User.rb:</p>
  
  <pre><code>    devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :omniauth_providers =&gt; [:facebook]
  
  has_many :posts
  
  def self.from_omniauth(auth)
        puts auth
        where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
          user.provider = auth.provider
          user.uid = auth.uid
          user.email = auth.info.email || ""
          user.password = Devise.friendly_token[0,20]
       end
  end
  </code></pre>
  
  <p>And these are the related gems I'm using:</p>
  
  <pre><code>gem 'geocoder'
  gem 'devise'
  gem 'omniauth'
  gem 'omniauth-facebook'
  </code></pre>
  
  <p>This has been driving me crazy for the past few days and I'm stuck. Any suggestions would be greatly appreciated. If there are things that might be related that I accidentally left out, let me know and I'd be glad to post them. Thanks!</p>