1

I am implementing Omniauth-facebook in my Rails project, while trying to login it returns only limited info, it is not returning email, I have used the following code in omniauth.rb initializer.

omniauth.rb (Initializer)

OmniAuth.config.logger = Rails.logger

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, '296183987424166', '45a1441f0527d9565a2030cba40b4eca', {scope: 'email, offline_access', info_fields: 'name, email'}
end

and the gem used are:

gem 'omniauth'
gem 'omniauth-facebook', '1.4.0'
halfer
  • 19,824
  • 17
  • 99
  • 186
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88
  • Um...This is the recent change to FB api. The email has now become optional to the user to give. And also...Did you just give out your `APP_ID` and `APP_SECRET` over the internet? [possible dupe?](http://stackoverflow.com/questions/31954540/ruby-on-rails-omniauth-facebook-doesnt-return-email?rq=1) – manu29.d Sep 08 '16 at 08:42
  • 1
    Since you just exposed your app secret here, you need to go reset it via the app dashboard __now__. (Right now, everyone can get the info you have shown here to get a valid app access token for your app, and do all kinds of stuff with it.) – CBroe Sep 08 '16 at 10:06
  • 1
    And permission `offline_access` has been removed _ages ago_. – CBroe Sep 08 '16 at 10:07

0 Answers0