Spotify integration calling wrong clientID

Hi all,

I have had a spotify integration for some time, but it broke last week for some unknown reason.
As I had some changes in my spotify accounts in the meantime, I have recreated a new app in my new spotify account as per documentation (Spotify - Home Assistant) .

Unfortunately when adding the integration I get the infamous “INVALID_CLIENT: Invalid redirect URI” error.

The problem I have detected: the integration calls https://accounts.spotify.com/authorize?response_type=code&**client_id=867d427xxx**&redirect_uri=https://my.home-assistant.io/redirect/oauth&state=[state]&scope=[scope]
Where the client_id 867d427xxx is the client_id of my old application (that doesn’t exist anymore).

Changing the client_id manually in the URL gives me the next configuration step, but an error on confirmation (probably because the secrret key is not valid). I find no way to reset it… (properly removing the integrtion didn’t work)

I suppose that my old spotify credentials are still kept somewhere in a HA database, but where and how can I remove them?

Thanks!

I have exactly the same problem.
Any ideas?

Thank you

Solved!!!
You have to find a file called application_credentials and delete everything related to Spotify


{
“domain”: “spotify”,
“client_id”: “4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9”,
“client_secret”: “8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf”,
“name”: “Spotify”,
“id”: “spotify_4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9”
}

1 Like

Yes, it works! Thank you…
(PS for me file was in \config\.storage directory)

Thank you! Saved me!

Guys!
Anybody else with this problem?

I can’t find the application_credentials

(there’s not a “storage directory” in my install…

There should be one, but it’s hidden by default. (thereby the dot at the start of the name)

In Linux, ls -a will display it.
If you are browsing through Windows explorer, you might need to activate the “Show > Hidden Items” option under “View”

1 Like

Reset Spotify integration

  1. Within the file /etc/home-assistant/.storage/application_credentials.
    To list the directory use ls -la or ls -a as it is hidden by default by the dot-prefix.
  2. Remove the Spotify entry.
{
“domain”: “spotify”,
“client_id”: “4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9”,
“client_secret”: “8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf”,
“name”: “Spotify”,
“id”: “spotify_4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9”
}
  1. Restart homeassistant docker restart homeassistant .

@nc-jeni @Chacsam @GusThePenguin @mroggi @German_Ferrer_Garrig
In case anyone is still monitoring this thread …

Application Credentials can be managed by the following link (adjust to your HA prefix): http://homeassistant.local:8123/config/application_credentials.

You can also get there from the Settings \ Devices & Services menu, then click on the “3 dots” icon at the top right, then Application Credentials menu item.

From there, it’s simply a matter of checking the entries you want to remove, then click Remove Selected that will appear at the top right after something is selected.

Hope it helps!

1 Like