Spotify - INVALID_CLIENT: Invalid redirect URI

I keep getting this message. I have a very standard configuration shown below. I got my client id and password, put in the URI below and I still keep getting this message when I click on unused entitites and try to configure Spotify. I’m not using the HTTP: component and I don’t access my device outside of my network. Is that the issue, or could this be something else?

Redirect URIs
http://192.168.0.47:8213/api/spotify

media_player:
  - platform: spotify
    client_id: YOUR_CLIENT_ID
    client_secret: YOUR_CLIENT_SECRET

Anyone have any thoughts here? Every post I read on the topic was talking about SSL or remote access settings with duckdns.

Already find a solution? I got the same problem :frowning:

Nope :(. I cant find anything to make this work. What type of install do you have?

Do you have an external domain it can connect to?

The spotify component will only work if spotify are able to access the page outside of your network. It won’t work with a 192.168.x.x (internal) IP address.

Same problem…
I can’t find any solution :frowning:

Having the same issue.

I have external access via Home Assistant Cloud. When it sends me to the error page it always shows the internal IP in the redirect, But have only the external address set in the Spotify Developers Console???

I even tried doing the auth while connected to my mobile and the error still showed the internal IP of my HASS.

Not sure what the issue is. Will try tomorrow doing it with duckdns.

So finally got it working.
Forgot to add the base URL to http in configuration.yaml. and then success after about 3 restarts.

Looks like it must have an external url to work properly.

1 Like

i have the same in configuration.yaml and in spotify but still get the [INVALID_CLIENT: Invalid redirect URI

1 Like

Does the base URL include the /api/spotify? I have had no success with the spotify component.

Any idea how to solve this issue? I do have the same problem: I have access from the outside via https, I set the base_url correct and I also set the callback url in the spotify developer acc, but I still get the error: INVALID_CLIENT: Invalid redirect URI

What was the base code ?

What was tge callback setting ?

Same problem here. Used http://192.168.1.X:8123/api/spotify

Hi,

sorry for my late reply. I am using a reverse proxy to reach my HA from the outside. Therefore I have set my base url under the http part in configuration.yaml with the port number. Then you also have to set callback url at the Spotify dev acc without port number. This works fine now for me.

1 Like

I think you need to have HA to be reachable from the internet to use the Spotify component. A local IP address won’t work as callback url for Spotify.

Just a moment ago I had the same problem and that led me to this topic.
I also used private IP address in the Redirect URI field. It turned out that the thing that prevented the configuration from working was a lack of port on which I access my instace of HA stated in the address.
So I had http://192.168.x.y/api/spotify instead of http://192.168.x.y:8123/api/spotify. After adding the port everything worked perfectly.
I know that this story can’t help solve the problems described above, but surely it disproves the statement that it’s not possible to have spotify working on a private IP address.
Moreover, the spotify’s documentation says: http://<your_home_assistant_url_or_**local_ip**>/api/spotify.

4 Likes

@krastek Thank you, this worked for me!

Hi

I am getting same issue when trying to link Spotify

My instance is not directly exposed, instead i use Hass Cloud subscription

Can someone please assist in how to configure Spotify to work in this instance

@buzurk

Go to https://developer.spotify.com/dashboard/applications/ login and open your app.

Next, edit settings and add your URI in the whitelist: Redirect URIs

1 Like