Spotify Callback URI error

edrhuang picture edrhuang · Nov 5, 2014 · Viewed 11.5k times · Source

I'm working on my first app using ruby on rails and have run into a few problems when I deploy to Heroku. When I sign into Spotify on my app I get an error saying:

INVALID_CLIENT: Invalid redirect URI

in my console the error reads:

Failed to load resource: the server responded with a status of 400 (Bad Request)

At first I thought it was an issue with my Client ID and Secret, because I ran into a similar error locally. So I regenerated new ones and I still have the same issue.

Then I noticed my callback URI didn't include a 's' in the callback url, so I added it and changed the callback on my Spotify App page, but I still receive the same error.

Although I changed the callback url in Spotify's app page, when I am in my app and I try to log in the url still doesn't contain an 's'.

Am I missing something or is something happening on Spotify's end? (I don't have this issue when I run this app locally)

Answer

Michael Thelin picture Michael Thelin · Nov 5, 2014

The important thing is that the redirect URI specified in My Applications match the redirect URI that you're specifying in the request to Spotify's API.

My guess would be that the redirect URIs still doesn't match, since that's the error message you're getting. Mind that editing the URI isn't enough, you need to click the 'Save' button to persist your changes.