omniauth-oauth2: 1.4.0 makes my rails app unable to sign in with facebook

rails 4.1.13 devise 3.5.2 omniauth (1.2.2) omniauth-facebook (2.0.1)

1.3.1 was fine

Error:

(facebook) Authentication failure! invalid_credentials: OAuth2::Error, :
{"error":{"message":"Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100,"fbtrace_id":"GjHr4Inn5Rq"}}

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 41 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to fix the issue by restoring the callback_url method to my subclass of OAuth2

module OmniAuth
  module Strategies
    class MyStrategy < OmniAuth::Strategies::OAuth2
        ...

        def callback_url
           full_host + script_name + callback_path
        end

        ...

see breaking change

It seems rediculous that this change occurred for ONE strategy and broke every other single strategy out there… IMHO it would have made more sense for the one strategy that needed the query parameters to override callback_url in it’s own strategy.

Wouldn’t it be better to have this change activated by some kind of flag? It has proved to be non backwards compatible and since there’s no changelog and the project does not follow semver it is pretty hard to detect something like that might happen.

Would a contribution in that path be welcome?

@sferik is there not a better solution for this yet? 6 months later and I’m still running into this problem in oAuth Strategies.

How is this acceptable to just ignore?

Is there a plan to actually fix this given the Rails 5.0.0 incompatibility?

@samuraraujo Thanks. That fixed my problem as well.

gem 'omniauth-oauth2', '~> 1.3.1'