5
votes

In development mode, during the authentication callback phase from localhost/auth/facebook, I am faced with the following error

OAuth2::Error : {"access_token":"XXX","token_type":"bearer","expires_in":123}

This is the location of the error

enter image description here

This is the stack trace

oauth2 (0.9.4) lib/oauth2/client.rb:140:in `get_token'
oauth2 (0.9.4) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.1.2) lib/omniauth/strategies/oauth2.rb:93:in `build_access_token'
omniauth-facebook (1.6.0) lib/omniauth/strategies/facebook.rb:145:in `block in build_access_token'
omniauth-facebook (1.6.0) lib/omniauth/strategies/facebook.rb:171:in `with_authorization_code!'
omniauth-facebook (1.6.0) lib/omniauth/strategies/facebook.rb:145:in `build_access_token'
omniauth-oauth2 (1.1.2) lib/omniauth/strategies/oauth2.rb:75:in `callback_phase'
omniauth-facebook (1.6.0) lib/omniauth/strategies/facebook.rb:71:in `callback_phase'
omniauth (1.4.2) lib/omniauth/strategy.rb:227:in `callback_call'
omniauth (1.4.2) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.4.2) lib/omniauth/strategy.rb:164:in `call'

I am using the following gem versions

  • oauth (0.5.1)
  • oauth2 (0.9.4)
  • omniauth (1.4.2)
  • omniauth-facebook (1.6.0)

I suspect it is an issue with the gems not being compatible with data being sent back by Facebook.

Any pointers on how to go about this challenge?

Update: Adding image of the error for Deepak

enter image description here

1
What is the error? Please add the error as well - Deepak Mahakale
Hello deepak, my apologies, I am not fully understand your question properly, as I believe I have shared the error in the first few lines. Regardless, I have added a screenshot of the error. - chickensmitten
The access token return format has changed, see stackoverflow.com/questions/42994019/… Pretty sure I saw a question about that and owin here in the last couple of days, too, and that the person there fixed it by updating their packages. - CBroe

1 Answers

5
votes

You might be using older gem version. It might be a good idea to update the versions if that is feasible for your application. Also, check that in your environment you are able to talk to Facebook and there are no proxy issues.