Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

invalid_request: redirect uri mismatch between auth code and token #5

Closed
sina-s opened this issue Apr 14, 2017 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sina-s
Copy link

sina-s commented Apr 14, 2017

First of all thanks for the great Gem.

I'm using
gem 'omniauth', '> 1.6.1'
gem 'omniauth-oauth2', '
> 1.3.1'
gem 'omniauth-facebook', '~> 4.0.0'

During the callback phase, I get an "invalid_request: redirect URI mismatch between auth code and token" error. The issue seems to be introduced in omniauth-oauth2 1.4.0: omniauth/omniauth-oauth2#93
And the callback_url method redefinition proposed in the thread solves the issue.
Since the beginning, this gem has been dependent on omniauth-oauth2 1.4.0. Wondering if there is a work around that it's working with 1.4.0 or can the dependency downgraded to omniauth-oauth2 1.3.1 or possibly defining callback_url in the strategy?

@jonhue jonhue added the bug Something isn't working label Apr 14, 2017
@jonhue jonhue self-assigned this Apr 14, 2017
@sina-s
Copy link
Author

sina-s commented Apr 14, 2017

I think whether passing params or not, or which ones to pass in the callback_url is very vendor specific matter. Overriding it per strategy makes the most sense to me. Opened a PR for it: #6

@jonhue
Copy link
Owner

jonhue commented Apr 14, 2017

Thank you for helping out. I already made these changes locally, but had no time to test it. If it works well for you, we should merge it. :)

@jonhue jonhue closed this as completed Apr 14, 2017
@jonhue
Copy link
Owner

jonhue commented Apr 14, 2017

I am going to push this to rubygems in the next 3-4 days.

@sina-s
Copy link
Author

sina-s commented Apr 14, 2017

I have tested it, works fine. BTW, there is a better/more generic fix in omniauth-oauth2: omniauth/omniauth-oauth2#100 waiting to be merged. I believe that also fixes the issue and this can be reverted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants