Spotify external integration: HTTPS redirect URL?

Hello,

I’m trying to create a Spotify plugin with my account. I have successfully created the APIWeb, noted the ID and the secret, but I don’t understand what to put in the return address. I have made several attempts without success. I get the message « redirect_uri: Not matching configuration » and I am not connected.

Can you indicate more clearly what should be entered in this field?

Thank you.

The Spotify API requires an address for verification. You must either be in HTTPS or be in localhost 127.1.0.0

HTTPS: Not many people have an HTTPS setup. Otherwise, you would need an address going through Gladys Plus, but it’s complicated for an external service.

And localhost means you have to launch Gladys from a browser directly from the machine where Gladys is installed. Impossible, because for many people, Gladys runs on a Linux Ubuntu server. So, you connect from an address like 192.168.x.x. And this address is not valid for Spotify.

I found a way to bypass the issue, but it means you have to be very strict about the address you declare on the Spotify side.

I’m not at home, but as soon as I get back, I’ll give you the procedure and the address to specify.
I’ll look into improving the documentation.

Hello!

Thanks for bringing this up, the topic is important and goes way beyond Spotify.

Why it’s blocked

Spotify tightened its security rules at the beginning of 2025 (applied to new apps since April 9, 2025, and to all apps since November 2025). An OAuth redirect URL is now only accepted if:

  • it is in HTTPS, or
  • it’s an explicit loopback address: http://127.0.0.1:PORT or http://[::1]:PORT.

localhost is no longer accepted, and a local IP in HTTP (http://192.168.1.50) is not either. Yet, this is exactly how most of you access Gladys at home: a local IP, in HTTP, without a certificate. Hence the famous redirect_uri: Not matching configuration.

This is a common issue for all self-hosted projects; Home Assistant faced the same problem.

The workaround for now

The one mentioned by @Will_71 works: declare the Gladys callback URL on Spotify’s side by replacing the local IP with 127.0.0.1 (keeping the port and path exactly the same), then launch the authorization from a browser running on the machine where Gladys is installed, or via an SSH tunnel (ssh -L) from your PC.

It works because Spotify only checks that the URL matches character by character; it never needs to join it itself.

But let’s be honest: it’s perfect for tinkerers, and unusable for someone who controls their Gladys from their phone. This is not an acceptable long-term solution.

The real solution: an official Gladys redirect URL

I will set up an official HTTPS redirect URL, hosted by Gladys, on the same principle as what Home Assistant does with my.home-assistant.io.

The principle:

  1. This official URL (in HTTPS, therefore accepted by Spotify) is the one you declare in your Spotify app; no need for a certificate or a domain name at your end.
  2. After your authorization, Spotify redirects to this page, which simply redirects your browser to your local Gladys, with a confirmation screen clearly indicating the address you will be redirected to.
  3. Your instance completes the exchange itself and stores the tokens locally.

Important point on privacy: this page is entirely static, with no server behind it. Your Spotify credentials, access tokens, and data never pass through our servers; the page only does a redirect in your browser, exactly like Home Assistant does.

Other advantages:

  • it will work for all external integrations that use an OAuth2 connection, not just Spotify;
  • no need for Gladys Plus or subscription: it’s available to everyone;
  • for those who already have an HTTPS URL (domain name, reverse proxy), you can continue to use yours.

I’ll take care of the setup and get back to you here as soon as it’s available, with the updated documentation. In the meantime, the 127.0.0.1 workaround above allows you to get by.

Thanks for reporting the issue :slight_smile:

Perfect.
Thanks @pierre-gilles :folded_hands:

I see that it’s actually a pretty common pattern, Synology does this, Freebox does this too :slight_smile:

Claude made me a proposal:

The site is being deployed on CloudFlare…

There you go, available at https://my.gladysassistant.com/

Now, there’s just a small adjustment needed in Gladys’ code :slight_smile:

Nice one!
So could the Netatmo service be reviewed to use this route? Or have the option to specify the route like for Spotify?
Or did I not understand correctly? :smiley:

No, it’s a completely different mechanism. :slightly_smiling_face:

Here, I’m simply proposing a redirect URL: everything happens in the browser. It’s only used for the OAuth flow to redirect the user to their instance after authentication. It’s free for me, so even if one day we reach the same scale as Home Assistant, I can continue to offer it without any problems.

For Netatmo, it’s a different architecture. Webhooks go through the Gladys Plus servers, which maintain a permanent WebSocket connection with each user’s local instance to transmit events in real time.

This infrastructure has a cost (servers, persistent connections, bandwidth, etc.), so it’s not something I can offer for free. :slightly_smiling_face:

oh yes I see I hadn’t understood at all XD
Thanks for your feedback.
I’ll take another look at your offer to see if it’s more interesting now that certain plugins are coming :slight_smile:

Thank you! :blush:

I think Gladys Plus remains very affordable given the services offered. And beyond the features, it also helps fund a French open-source project :wink:

The more Gladys Plus grows, the more time I can devote to Gladys and offer you new features, improvements, and better compatibility with your equipment.

In the end, everyone benefits. :grinning_face_with_smiling_eyes:

The PR:

This will also be useful for Daikin :slight_smile:

PR merged, redirects via my.gladysassistant.com will be available in the next Gladys release :slight_smile:

It’s available for all external integrations that use Oauth without any changes on the external integration side!

Hi everyone,

Quick update on the Spotify integration. I entered the address provided by @pierre-gilles, and I really thought it was working. I got to the Spotify login page, entered all the required information (login email and security code received by email) and BAM, back to the same page with an error message.

Maybe I was too impatient and the new update isn’t installed yet.
Is that possible,

Thanks

Yes, you still need to wait a little longer.
I’ll try it on my end first and as soon as it’s okay, I’ll let you know.

@pierre-gilles, I confirm that the https link works very well.

@l.dolle, when the update is released:

The https page will then open and you can validate. The account is connected

You can check if you want one of your devices to open with the Test Connection action

Excellent, thanks for testing! I’m releasing it tonight!

It’s live in 4.84.4: