I try to auth user through my app with spotify Web API but I receive this error:
INVALID_CLIENT: Invalid redirect URI
URL:
GET
+1 to adding 'http://localhost:8888/callback' to the Redirect URIs list in your App's settings via https://developer.spotify.com/dashboard/applications
It's a shame this is not mentioned on the quick start: https://developer.spotify.com/documentation/web-playback-sdk/quick-start/
You have to add the redirect URI to the White-list in "My Applications" panel.
e.g http://example.com/callback/
app.js:
var redirect_uri = 'http://localhost:8888/callback';
(https://developer.spotify.com/dashboard) Spotify > My application:
http://localhost:8888/callback
Dont forget to save.
I ran into a similar issue when authenticated via Authorization Code Flow.
Per the docs The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.
So make sure that the:
redirect_uri
that is configured in the dashboardredirect_uri
in the GET https://accounts.spotify.com/authorizeredirect_uri
in the POST https://accounts.spotify.com/api/tokenis exactly the same or else you will get a INVALID_CLIENT: Invalid redirect URI
I played around with various URLs for some time, none of them gave me the correct functionality except http://localhost:8888/callback/
(note the trailing slash). Be sure to add that to the whitelist as well.