0
votes

The bottom line is that the authorization through facebook, twitter, linkedin in CallbacksController in request.env ['omniauth.auth'] comes only uid and provider, no additional informations extra, credentials, etc. . And it does not happen every time, multiple requests can be valid, and then randomly get a hash with only two parameters. Does anyone know what the problem is and how to solve it?

devise (3.2.3) omniauth (1.2.1) omniauth-oauth2 (1.1.2) oauth2 (0.9.3)

2

2 Answers

0
votes

check you hash raising an exception

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
   def facebook
     raise request.env["omniauth.auth"].to_yaml # <----------
     .
     .
     .

if is really empty or just with provider and uid only i should assume that you miss configure your devise initializer or the applications in their corresponding pages, but it will be really weird that all the configurations where wrong.

0
votes

When using devise,and you wish to add a omniauth using facebook.There is a nice tutorial on rails casts. i recommend you follow the http://railscasts.com/episodes/360-facebook-authentication?view=asciicast and also follow this too. https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview. you will find what you looking for.