0

I'm trying to automate the creation of a token with the Spotify API, however the headless browsers I try to use always error at 'Invalid redirect_uri'. Currently I'm trying to use Spynner and Ghost.py, but both end up at the same problem point.

What I know so far:

  • The authorization URL is valid, as I can copy that into chrome and it will redirect to link with Spotify's response code

  • The redirect URI is also valid, again as I get a valid response through chrome

  • One odd note is when using Spynner, I check error response code and I note that the % sign has been replaced by %25. I'm not sure if this is being done by pyqt4, and I wonder if the second encoding of special characters is causing the problem. I tried passing a url without escaped special characters, but that didn't work either.

I'm at a loss as to why I can't get this to work. Why would a link in a headless browser not redirect like in Chrome?

PM8K
  • 21
  • 4

1 Answers1

1

Check your App's settings at https://developer.spotify.com/my-applications/. The redirect URI there needs to exactly match the one you use in order for Spotify to redirect.

arirawr
  • 1,255
  • 9
  • 22
  • I have checked that, which is what confuses me. When I paste the URL into chrome I'm redirected as I should. It's when passing it into some other headless browser that seems to be creating the issue. – PM8K May 10 '17 at 17:32