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:
- http://localhost/callback
- http://localhost
- http://localhost:80/callback
- localhost:80/callback/
- http://localhost/callback/
- http://localhost:/callback/
- http://127.0.0.11.4k
- http://127.0.0.1
- http://127.0.0.1/
- http://127.0.0.1/callback/
- http://localhost.me
- http://localhost/
Has anyone run into and resolved this problem?
(edit: the localhost.me was an attempt to use something not localhosty by modifying hosts)