-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devise token auth + Save Facebook auth_hash info in database #326
Comments
👍 I am having the same issue |
According to the devise wiki on omniauth, it expects the response to have Instead I have in my response If you want to see the response, you can override the OmniauthCallbackController as described here and in the omniauth_success action, use a debugger. |
@gustavoguimaraes I could only find information in the auth_hash but when I change the scope it will not return new data. It seems as though the scope values are not getting passed correctly. |
@tylerbobella totally. Within request.env['action_dispatch.request.unsigned_session_cookie'] I see but no other info from public_profile or scopes values |
@gustavoguimaraes I'm running into the same problem – I'm especially missing the |
@gustavoguimaraes I was able to resolve this issue by adding the desired fields to the provider hash: # /config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider(
:facebook,
ENV['FACEBOOK_KEY'],
ENV['FACEBOOK_SECRET'],
scope: 'email',
info_fields: 'email,first_name,last_name')
end Now |
Closing this issue since it's somewhat out of scope for this gem and a configuration example for omniauth-facebook has been provided. Can re-open if need be though. |
I am using Devise auth token gem and ng-token auth for authenticating my single page app. Besides registering with email there is the option to sign-up via Facebook. It works.
My problem is that as for my Fb request scope I set to get the user_friends, email and public_info, however when I get the request I don't see the auth_hash request.env['omniauth.auth']. This is described in the omniauth-facebook gem documentation.
Basically I want to save what FB gives back about the user in my database. How would you do it?
https://stackoverflow.com/questions/31833159/devise-token-auth-save-facebook-info
The text was updated successfully, but these errors were encountered: