1

I've tried to authorize an app to use the Spotify API a few ways so far, but no matter what it says invalid redirect_url.

<a href="https://accounts.spotify.com/authorize/?client_id=bed1f08b5dec405888c5c66c0e7b35ef&
response_type=code&redirect_uri=http://localhost/callback&scope=user-read-private%20user-read-email&
state=34fFs29kd09">Authorize Spotify</a>

Also I tried to borrow code from Exportify (https://github.com/watsonbox/exportify):

authorize: function() {
    client_id = "bed1f08b5dec405888c5c66c0e7b35ef"
    window.location = "https://accounts.spotify.com/authorize" +
      "?client_id=" + client_id +
      "&redirect_uri=" + encodeURIComponent([location.protocol, '//', location.host, location.pathname].join('')) +
      "&scope=playlist-read-private%20playlist-read-collaborative" +
      "&response_type=token";
}

But I still get invalid redirect_url. I've whitelisted the following urls in the app management panel:

Has anyone run into and resolved this problem?

(edit: the localhost.me was an attempt to use something not localhosty by modifying hosts)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
BWStearns
  • 2,567
  • 2
  • 19
  • 33

2 Answers2

2

So. After trying lots of futile ways of addressing this problem I went back to the app management page. It turns out that URLs are not whitelisted when you type them in and click add, but rather when you then scroll down to the bottom of the page and hit save. I hadn't navigated away or scrolled down until then. The warning that you need to save is helpfully below the fold by the save button.

BWStearns
  • 2,567
  • 2
  • 19
  • 33
  • 1
    Hey @BWStearns, sorry you ran into this issue. We're aware of it, and we're working on a fix now. – Hugh Rawlinson Feb 22 '17 at 18:39
  • @HughRawlinson No worries! I think if the warning were at the top of the page or at least above the fold no one would run into the issue (looking back on posts I found while trying to solve this I think others have hit it as well). Thanks a ton for reaching out! (also I didn't mean to be snarky in my answer, I was just really tired!) – BWStearns Feb 22 '17 at 22:44
0

Just ran into this problem from my Macbook Pro running Chrome Version 114.0.5735.198 (Official Build) (arm64) Solved by using Safari.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/34674303) – user12256545 Jul 17 '23 at 18:32