Invalid redirect URI on spotify auth

I try to auth user through my app with spotify Web API but I receive this error:

INVALID_CLIENT: Invalid redirect URI



I cant see where is the problem... Can you help?


You have to add the redirect URI to the White-list in "My Applications" panel.



var redirect_uri = 'http://localhost:8888/callback';

Spotify > My application:


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:

  1. redirect_uri that is configured in the dashboard
  2. redirect_uri in the GET
  3. redirect_uri in the POST

is exactly the same or else you will get a INVALID_CLIENT: Invalid redirect URI

First. You have to be sure that you're using app.js from authorization_code directory.

Second. Be sure you edited app.js. That third line is important.

var client_id = '---'; // Your client id
var client_secret = '---'; // Your secret
var redirect_uri = 'http://localhost:8888/callback'; // Your redirect uri - EXAMPLE

I use the SpotifyAPI-NET API wrapper by JohnnyCrazy and was having this problem despite adding the URL I specified in my wrapper call to my white list as specified above.

The browser's address bar should show the redirect URL it is using buried in the middle of the string - I found that it was also making a request with "" as the redirect URL - perhaps the wrapper is making 2 API calls, but I found that only by whitelisting both this URL and the one I was specifying would it work for me.

+1 to adding 'http://localhost:8888/callback' to the Redirect URIs list in your App's settings via

It's a shame this is not mentioned on the quick start:

Need Your Help

Example of delayed expansion in batch file

batch-file cmd delayedvariableexpansion

Can someone give me an example of where a batch script would act differently with or without delayed expansion? Are there any situations where you would NOT want to use delayed expansion? Thanks.

What is the difference between public, private, and protected?

php oop private public protected

When and why should I use public, private, and protected functions and variables inside a class? What is the difference between them?