guilhermesad / rspotify

A ruby wrapper for the Spotify Web API
MIT License
717 stars 290 forks source link

OAuth2::Error when trying to login after 2.6.0 #189

Closed mattdrewitt closed 3 years ago

mattdrewitt commented 5 years ago

What seems to be a long standing issue with omniauth-oauth2 (https://github.com/guilhermesad/rspotify/issues/87 and https://github.com/guilhermesad/rspotify/issues/80) is an unavoidable issue with 2.6.0 as the min version is over the working 1.3.1. Simply forking this project, and setting the gemspec to only require 1.3.1 fixed this issue and oauth works as expected.

Error received on omniauth-oauth2 1.5.0 (default in rspotify version 2.6.0): invalid_grant: Invalid redirect URI {"error":"invalid_grant","error_description":"Invalid redirect URI"}

I'm never an advocate for rolling back a gem version, but using the config provided in the readme does not work from a fresh install from what I can tell. So either rolling back the version, or updating the strategy seems in order?

Thanks!

jean-francois-labbe commented 5 years ago

You can make it work with ruby 2.6.0 and omniauth-oauth2 1.5.0 by redefining callback_url function as explained here: https://github.com/guilhermesad/rspotify/issues/87#issuecomment-501673907