Cannot Configure Spotify Integration - Invalid Redirect URI

I’m having trouble configuring the Spotify integration. The integration is appearing in the UI, but when I go to authorize it, I get an INVALID_CLIENT: Invalid redirect URI error. I think this is caused by the redirect_uri=http://192.168.0.2:8123/auth/external/callback parameter in the URL, which doesn’t match the app settings: https://ha.home.my.domain/auth/external/callback .

Browsing to this URL gives a Missing code or state parameter message, which sounds like the right behaviour. The incorrect address was from an old config, and isn’t valid anymore. I guess it’s cached somewhere but I can’t seem to find where.

Hello @Nassau. I have the same problem. Did you ever figure this out?

Best regards
CF6

Same for me. I thought it was because the IP address is private so I tried from my nabucasa URL and got the same result.

Not much noise about this so I’m not too enthusiastic about a solution :frowning:

Same problem here…
Settings in Spotify Developer App setup is correct, but adding the Spotify Integration from HA results in “INVALID_CLIENT: Invalid redirect URI”. And yes, the redirect URI is “https://MYDOMAIN/auth/external/callback” (not the older settings). Btw, the Spotify integration had been working flawless until a recent HA update broke it…
Anyone had any success fixing this?

Hope this helps you folks out:

2 Likes

Setting internal URL fixed it for me:

https://yourhassinstance:8123/config/core under General add internal and external URL, in my case I had dyndns and SSL enabled, so I had to set both to my external address.

I got a different error about a missing code or parameter or something. But i went ahead with adding the spotify integration and it worked anyway.

2 Likes

Got the same error
Missing code or state parameter in https://xxx/auth/external/callback

Ignoring it and adding the integration from inside HA worked just fine :slight_smile:

worked for me. Thanks

This worked for me also! Mine came back like such…

(http://homeassistant.local:8123/auth/external/callback) This instead of the actual local IP.

Thank you!!

Hello,

I have a similar problem
My error is: INVALID_CLIENT: Failed to get client

I don’t understand why in the redirect URI I have https://my.home-assistant.io/redirect/oauth. (I specify that I did not modify anything, that it is the domain that the connection link gives me.)
You understand that this is therefore not the right domain.

https://accounts.spotify.com/authorize?response_type=code&client_id=MYCLIENTID&redirect_uri=https://my.home-assistant.io/redirect/oauth&state=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.edfgxNjM3OGUzODExN2Y0YTM5MWMxNTExNTkiLCJyZWRpcmVdfswczovL215LmhvbWUtYXNzaXN0YW50LmlvL3JlZGlyZdgn0.ZG3uWYLMd8kP5j0af_w0R8CHEowR37N5t3DbiVZPTjs&scope=user-modify-playback-state,user-read-playback-state,user-read-private,playlist-read-private,playlist-read-collaborative,user-library-read,user-top-read,user-read-playback-position,user-read-recently-played,user-follow-read

However, in the settings of my home assistant, I have my domain name.

I specify that in the past the integration functioned.
I am using a duckdns domain name with an NGNX reverse proxy.
Home Assistant is installed on Docker.

Thank you for the help

Adding only one call back URL to my Spotify Developer account worked for me.

https://my.home-assistant.io/redirect/oauth

1 Like