# Spotify external integration: HTTPS redirect URL?

**URL:** <https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439>\
**Category:** Configuration\
**Tags:** integration-externe\
**Created:** [August 3, 2026, 3:01pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439 "2026-08-03T15:01:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![l.dolle](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/l.dolle/32/17380_2.png) [@l.dolle](https://community.gladysassistant.com/u/l.dolle)\
**Post date:** [August 3, 2026, 3:01pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/1 "2026-08-03T15:01:32Z")

</div>

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 «&nbsp;redirect\_uri: Not matching configuration&nbsp;» and I am not connected.

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

Thank you.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 3, 2026, 4:27pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/3 "2026-08-03T16:27:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 4:57pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/4 "2026-08-03T16:57:02Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 3, 2026, 4:59pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/5 "2026-08-03T16:59:42Z")

</div>

Perfect.  
Thanks @pierre-gilles 🙏

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 5:24pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/6 "2026-08-03T17:24:08Z")

</div>

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

Claude made me a proposal:

 ![Capture d’écran 2026-08-03 à 19.23.13](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/f/b/fb6c6a601e09988818c1baf153356f878e5a25a6.png)

The site is being deployed on CloudFlare…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 5:28pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/7 "2026-08-03T17:28:16Z")

</div>

There you go, available at [https://my.gladysassistant.com/](https://my.gladysassistant.com/)

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

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [August 3, 2026, 5:32pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/8 "2026-08-03T17:32:05Z")

</div>

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? 😃

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/d/7d008e283a910c5155ff3e0fa335af5dc25d5edc.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 5:38pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/9 "2026-08-03T17:38:23Z")

</div>

> [@spenceur](#):
>
> Could the Netatmo service be revised to use this route? Or have the option to specify the route like for Spotify?

No, it’s a completely different mechanism. 🙂

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. 🙂

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [August 3, 2026, 5:40pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/10 "2026-08-03T17:40:33Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 5:42pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/11 "2026-08-03T17:42:47Z")

</div>

Thank you! 😊

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

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. 😄

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 7:09pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/12 "2026-08-03T19:09:11Z")

</div>

The PR:

> <https://github.com/GladysAssistant/Gladys/pull/2769>
>
> \### Description
> 
> OAuth2 providers now require an HTTPS redirect URI. Spotify \[en…forces it since April 2025\](https://developer.spotify.com/documentation/web-api/concepts/redirect\_uri): only \`https://\` is accepted, plus the loopback literals \`http://127.0.0.1:PORT\` and \`http://\[::1\]:PORT\` — \`localhost\` is refused, and so is any LAN address.
> 
> The frontend built \`redirect\_uri\` from \`window.location.origin\`, so anyone reaching Gladys at \`http://192.168.1.50:1443\` — most self-hosted users — got \`redirect\_uri: Not matching configuration\` and simply could not connect a Spotify account.
> 
> \`redirect\_uri\` is now the fixed HTTPS page \`https://my.gladysassistant.com/redirect/oauth\` (static site, source in \[GladysAssistant/my.gladysassistant.com\](https://github.com/GladysAssistant/my.gladysassistant.com)). The address to come back to travels in the OAuth2 \`state\`, the only parameter a provider hands back untouched:
> 
> \`\`\`js
> state = base64url(JSON.stringify({ v: 1, origin, path, state: '\<the integration state\>' }));
> \`\`\`
> 
> The redirect page unwraps it, shows the visitor which instance they are about to return to, and bounces them there with every provider parameter forwarded. Nothing runs server-side there: no authorization code, token or credential ever reaches a Gladys server. It only redirects to an HTTPS origin or to a plain-HTTP origin that can exist solely on the visitor's own network, always behind an explicit click.
> 
> This is the same approach Home Assistant takes with \`my.home-assistant.io\`.
> 
> \*\*Integrations need no change.\*\* They already receive the \`redirect\_uri\` and use it as-is (\`onOAuthAuthorizeUrl(key, redirectUri)\`), and they get their own \`state\` back to verify. The server is untouched too — the whole change is in the frontend.
> 
> Also in this PR:
> 
> \- the configuration screen now \*\*shows the redirect URI to copy\*\* into the provider's developer application, with a copy button. Guessing it wrong is what people were stuck on in the forum thread.
> \- users who already serve Gladys over HTTPS can \*\*opt out\*\* and use their own address instead (offered only when the frontend is served over HTTPS, remembered in \`localStorage\`).
> \- the \`redirect\_uri\` used is stored alongside the oauth2 key so the callback sends back exactly the same one — the provider compares it byte for byte at token exchange.
> 
> \*\*One behaviour change for integration authors\*\*: the \`state\` becomes mandatory in the authorize URL. Without it there is no way home, so an integration that omits it now gets an explicit error message instead of failing silently. \`docs/specs/external-integrations.md\` is updated accordingly.
> 
> A side benefit worth knowing: a single URL now has to be declared at the provider, whether the user reaches Gladys locally or through Gladys Plus. Before, the redirect URI depended on how you were browsing.
> 
> \## Forum
> 
> Forum: https://community.gladysassistant.com/t/impossible-de-creer-le-plugin-spotify/10439
> 
> \### Checklist
> 
> \- \[\] Tests pass: \`cd server && npm run coverage\` (Codecov requires 100% coverage on changed lines) and Cypress (\`npm run cypress:run\`) if the UI changed
> \- \[x\] Linter and prettier pass on both front and server (\`npm run eslint\`, \`npm run prettier\`)
> \- \[x\] No undocumented breaking change
> 
> On the first box, being explicit about what was and was not run:
> 
> \- No server code changed, so the server suite is untouched by this PR.
> \- Cypress was not run — it needs a live Gladys stack with an installed external integration.
> \- \`npm run build\`, \`npm run eslint\` (0 errors), \`npm run prettier-check\` and \`npm run compare-translations\` all pass on the front.
> \- The wrapping was verified end to end against the redirect page: a realistic Spotify authorize URL goes through \`wrapAuthorizeUrl()\`, then through the page's \`decodeWrappedState()\` / \`buildRedirectUrl()\`, and comes back as \`http://192.168.1.50:1443/dashboard/.../oauth-callback?code=…&state=\<the integration state\>\` with \`client\_id\`, \`scope\` and \`redirect\_uri\` untouched. The redirect page itself has 15 unit tests covering the origin and path checks.
> \- The front has no unit test runner today, so \`front/src/utils/oauth.js\` ships without tests. Happy to add one if you want a runner introduced.
> 
> \---
> \_Generated by \[Claude Code\](https://claude.ai/code/session\_0197FhTmFSecAUY5CqCYG7vN)\_
> 
> 
> \## Summary by CodeRabbit
> 
> \- \*\*New Features\*\*
> - Added copyable HTTPS redirect URIs for OAuth setup.
> - Added support for instance-specific redirect addresses when available, with a user-selectable option.
> - Improved OAuth callback handling with stronger security-state validation.
> - Added clearer connection guidance and invalid-state error messages.
> - Added English, German, and French localization updates.
> 
> \- \*\*Documentation\*\*
> - Expanded OAuth guidance covering redirect setup, local HTTP instances, callback routing, and token handling.

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [August 3, 2026, 7:15pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/13 "2026-08-03T19:15:09Z")

</div>

This will also be useful for Daikin 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 7:17pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/14 "2026-08-03T19:17:27Z")

</div>

A message was split into a new topic: [Spotify external integration: having a unique selector](https://community.gladysassistant.com/t/spotify-external-integration-having-a-unique-selector/10441)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 3, 2026, 7:37pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/15 "2026-08-03T19:37:40Z")

</div>

PR merged, redirects via [my.gladysassistant.com](http://my.gladysassistant.com) will be available in the next Gladys release 🙂

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

---

<div class="post-metadata">

**Author:** ![l.dolle](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/l.dolle/32/17380_2.png) [@l.dolle](https://community.gladysassistant.com/u/l.dolle)\
**Post date:** [August 4, 2026, 3:36pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/16 "2026-08-04T15:36:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 4, 2026, 3:55pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/17 "2026-08-04T15:55:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 4, 2026, 5:23pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/18 "2026-08-04T17:23:55Z")

</div>

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

@l.dolle, when the update is released:

- create an account on spotify  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/b/9bbe262c6e25dd5da2f3dbaa09df417ac79e78a8.png)
- add the address [Back to your Gladys](https://my.gladysassistant.com/redirect/oauth) to the spotify web page  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/0/6/06fe71df09614b22425130a326bfc6a371710336.png)
- check Web API  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/d/3db0a39cec7578f298234d4ab0c1a823f531f71b.png)
- indicate your client ID and client secret  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/2/32bd3d452d5000cbff398c6b324233ba625c2180.png)
- Register the configuration  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/d/1da0de76956b64eb54854de1c0e608ae03ed8fd4.png)
- And finally Connect  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/5/45c4e4337126d2cf9f3592be261fdc3d33514a70.png)

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

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/4/44c2f590fe4e62ea3fe3167744da535f09b092b2.png)

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

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/d/3d40ea57203cf3d71b387d490c7359084e6221f5.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 4, 2026, 5:59pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/19 "2026-08-04T17:59:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 4, 2026, 7:31pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/20 "2026-08-04T19:31:02Z")

</div>

It’s live in 4.84.4:

> [@Gladys Assistant 4.84.4: OAuth over HTTPS and value selector in scenes](https://community.gladysassistant.com/t/gladys-assistant-4-84-4-oauth-en-https-et-selecteur-de-valeurs-dans-les-scenes/10450):
>
> Hi everyone! A small evening release, following directly from yesterday’s feedback: the real Spotify OAuth fix (via HTTPS), the alarm bug during arming, and some very concrete UX improvements smileyExternal Integrations: OAuth2 via [my.gladysassistant.com](http://my.gladysassistant.com) Spotify (and modern OAuth providers in general) no longer accept a redirect\_uri in HTTP on a local IP (http://192.168.x.x). Result: most self-hosted installs were getting a redirect\_uri: Not matching configuration. This is fixed: Gladys n…

---

<div class="post-metadata">

**Author:** ![l.dolle](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/l.dolle/32/17380_2.png) [@l.dolle](https://community.gladysassistant.com/u/l.dolle)\
**Post date:** [August 7, 2026, 4:31pm UTC](https://community.gladysassistant.com/t/integration-externe-spotify-url-https-de-redirection/10439/21 "2026-08-07T16:31:18Z")

</div>

Hi everyone,

It works now.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/0/f/0f3f7ca8baec5e4f668464e2c6bd9032dbb39516.png)

I just tested it quickly and here are my remarks.

The plugin is fast if you stop or change tracks; the device reacts quickly. But when you stop the music (for example) with your phone (for example), the plugin reacts with a noticeable latency of three seconds. This might be normal, but I wanted to report this information in case it’s important or can be improved.

Thanks to @Will_71

Have a good evening.
