Reputation: 131
I'm a beginner to ruby and rails too, i'm developing a web app on rails-angular stack.The rails app is a JSON API. i've setup authentication with device_token_auth,omniauth_facebook, omniauth_google_outh2. Authentication is part is working fine so far. The problem now is, i need fetch some additional data from facebook and google (photo,about me,location etc). In my current setup everything is controlled by the gems, i've just configured all of them to work together.
Can someone please help me with the approach
To be able to fetch the info i need, do i have to write custom controllers and models ?
If i have to modify gem methods,models and controllers, how can i do that?
I tried few solutions from the community, but all of them suggested to have a sessions_controller. but i can't do that here because i'm using token based authentication. Thanks
Upvotes: 1
Views: 493
Reputation: 1474
As per the omniauth-facebook
readme: scope
is "A comma-separated list of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: https://developers.facebook.com/docs/reference/login/
Here is their example from Github:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
scope: 'email,user_birthday,read_stream', display: 'popup'
end
Upvotes: 1