Spotify integration via UI aborted

Good evening,
I wonder why it fails on my box. My redirect url on Spotify is defined as:
http://192.168.1.141:8123/auth/external/callback

yet the link is created as:

https://accounts.spotify.com/authorize?response_type=code&client_id=MyIDHERE&redirect_uri=http://192.168.1.141/auth/external/callback&state=MYSTATEHERE&scope=user-modify-playback-state,user-read-playback-state,user-read-private

you can see that my port 8123 gets swallowed and I end up with:

INVALID_CLIENT: Invalid redirect URI

What am I missing?

Thank you!

In my case, with new HA installs your HA it needs to be set in the menu - Configuration/General,
Scroll down and the internal/external addresses are set there

1 Like

Hey, I sort of have the same issue.
Not getting any logs or anything.

But I’ve added the Client ID and Client Secret to my configuration.yaml, added my external URL and my internal IP address including ports (8123) to the spotify dashboard.
Just getting an instantaneous “Aborted” when I try to add the integration.
Here is my system info:
arch armv7
chassis embedded
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.13
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v7l
python_version 3.8.5
supervisor 245
timezone Europe/Copenhagen
version 0.115.1
virtualenv false

Same here on my Home Assistant

Make sure your ip address is set in the config/general.

Weird, I do not have those in my settings menu.
Did some google search on it, and found that I can add it in my configuration.yaml.

homeassistant:
   external_url: “https//YOUR.duckdns.org”  
   internal_url: “https//YOUR.duckdns.org”

Add this bit, where you of course change URLs into the correct ones.
And now my Spotify Integration works!

Thank you @Danzal

3 Likes

Hi;
I have configured Spotify as media browser in HA 0.115.2
Works great, but how can I send the audio to any of my Google Home Mini? Is there any possibility to do that?
Thank you for your help!

EDIT:
I have solved it whit this

I have removed my Spotify integration and added a new app on the spotify dev page, configured the correct callback URL, have my external/internal URLs set up in HA (0.115.3) and when I try to add the Spotify integration I just get aborted like people above.

Any ideas?

I managed to get it to work, logged into HA from Chrome on my android phone (connected to wifi) and this allowed me to set it up all the way whereas Chrome on my windows PC did not

I have the same issue, updated the oauth login url and settings in configuration.yml, but only receive a “aborted” message during integration installation with no further errors (also nothing in the javascript console). :confused:

Hi everyone… what happens is you need to open Homeassiant with the same IP you in spotitfy Redirect RI ( http://<local_ip>/auth/external/callback ) otherwise home assistant will fail with “Aborted” message…

3 Likes

setting URL (local and external ) on the ui fix my issue :slight_smile:

@Scayn solution above fixed that precise problem for me

thank you

Great tips. I’ve added a pull request to get the docs updated.

1 Like

First off, thanks to everyone here, but I too ran into the dreaded URI issue. The wiki and this thread got me most of the way there, but this finished the install for me, so I am going to pass on what I learned in hope that it helps someone else.

Problem: “INVALID_CLIENT: Invalid redirect URI” issue.

Solution:
The problem was that I always authenticated to the “homeassistant.local:8123” domain and NOT 192.168.XX.XXX domain. Thus, when it was passing the URI of 192.168.XX.XX, I’d get that error. So, I logged into my HA by opening chrome and going to the 192.168.XX.XX:8123, logging in successful, then re-doing the integration and the error went away,

My setup:

  • hassio on RPI 4 running v 2020.12.7
  • No external ports; internal IP only.
  • I did set the internal/external URLs in the configuration > general section to my 192.XX address.
  • I do my config access via Chrome on windows

Hopefully this helps someone else .

1 Like

I can also confirm that these steps are mandatory to create a successful Spotify integration. It now showed a confirmation page with our Spotify account credentials as an extra step where it did not before.

This is exactly what enabled me to get past the URI and 500 Error issues – logging into to my local numeric IP address instead of homeassistant.local, and then following the steps as described in the official docs. Thank you!

1 Like

Thanks, worked for me, but remember to restart home assistant after making changes, at first i was getting "aborterd``error, after restarting it worked. acess from your ip, NOT from homeassistant.local.

1 Like

This error kept me busy for day’s. Thank you for the solution!!

1 Like

I did everything he mentioned and had it working. The secretkey on the side of Spotify had changed during the configuration. Now I am in some kind of loop where the url is not getting accepted. I can’t change the client secret anymore in the configuration of HA. I don’t get the screen for that it just directly open a window with the URL. How can I get the wrong key out of the HA configuration