ruby on rails - How to specify app_secret for a Koala object? -
in devise.rb
config.omniauth :facebook, app_id, 'app_secret', :scope => 'email', info_fields: 'email, name, address, birthday, age_range, first_name, gender, hometown, location '
in user.rb (model)
def facebook @facebook ||= koala::facebook::api.new(self.oauth_token) end
the oauth token user object set , following called.
user.facebook.get_object("me")
this response
{"name"=>"name", "id"=>"uid"}
i not additional information address, email, image link etc, although, if user made sign in via omniauth-facebook, params. should do?
it's because each user has things restricted or granted default, security settings. oauth, bumps user , says "if want access app, you'll need agree let have these permissions on account" -- user says ok , info need. users security settings let see other about-me info.
so... simple answer use oauth login. ensure token gives access things list in scope.
out of curiosity, there reason aren't asking oauth login already?
Comments
Post a Comment