[GH-ISSUE #810] INVALID_CLIENT: Invalid redirect URI when starting with client_id provided #1416

Closed
opened 2026-03-14 14:49:24 +03:00 by kerem · 8 comments
Owner

Originally created by @KUHLwasStolen on GitHub (Aug 25, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/810

Describe the bug
When starting the application with a client_id provided I received the error above in my browser.
Previously I didn't receive this, the only thing that changed was that I updated spotify_player.

To Reproduce
Set a client_id in the config file and start the application.

Log and backtrace
Unrelated, I think

Additional context
To fix this I added http://127.0.0.1:8989/login to the redirect URIs in my Spotify-for-developers app dashboard.

Maybe more recently created apps already have this URI by default, I don't know, but maybe we could add a little remark in the documentation on what to do if one receives this error.

Originally created by @KUHLwasStolen on GitHub (Aug 25, 2025). Original GitHub issue: https://github.com/aome510/spotify-player/issues/810 **Describe the bug** When starting the application with a `client_id` provided I received the error above in my browser. Previously I didn't receive this, the only thing that changed was that I updated `spotify_player`. **To Reproduce** Set a `client_id` in the config file and start the application. **Log and backtrace** Unrelated, I think **Additional context** To fix this I added `http://127.0.0.1:8989/login` to the redirect URIs in my Spotify-for-developers app dashboard. Maybe more recently created apps already have this URI by default, I don't know, but maybe we could add a little remark in the documentation on what to do if one receives this error.
kerem 2026-03-14 14:49:24 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sewnie commented on GitHub (Aug 25, 2025):

I also had to add this in my redirect URI list and it works fine. The previous redirect URI was localhost:8080, why was it changed?

<!-- gh-comment-id:3220039588 --> @sewnie commented on GitHub (Aug 25, 2025): I also had to add this in my redirect URI list and it works fine. The previous redirect URI was `localhost:8080`, why was it changed?
Author
Owner

@aome510 commented on GitHub (Aug 25, 2025):

The redirect URI is always http://127.0.0.1:8989/login see github.com/aome510/spotify-player@bd38dd05a3/examples/app.toml (L2)

The only thing changed is that now you need to authenticate spotify_player with your registered Spotify app for Spotify connect. Before, librespot was able to get a token corresponding to the registered app without going through the authentication.

Can you try to change login_redirect_uri in app.toml to a different value to see if it works?

Note that this is redirect URI is also used to authenticate the spotify_player with the official Spotify app when you first run it. I think Spotify app prob supports a wide range of redirect URIs.

Anyway, thanks for raising. Will need to update Spotify Connect doc to mention that user will need to set Redirect URIs accordingly based on the login_redirect_uri config option

<!-- gh-comment-id:3220383448 --> @aome510 commented on GitHub (Aug 25, 2025): The redirect URI is always `http://127.0.0.1:8989/login` see https://github.com/aome510/spotify-player/blob/bd38dd05a3c52107f76665dc88002e5a0815d095/examples/app.toml#L2 The only thing changed is that now you need to authenticate `spotify_player` with **your registered Spotify app** for Spotify connect. Before, `librespot` was able to get a token corresponding to the registered app without going through the authentication. Can you try to change `login_redirect_uri` in `app.toml` to a different value to see if it works? Note that this is redirect URI is also used to authenticate the `spotify_player` with **the official Spotify app** when you first run it. I think Spotify app prob supports a wide range of redirect URIs. Anyway, thanks for raising. Will need to update [Spotify Connect doc](https://github.com/aome510/spotify-player?tab=readme-ov-file#spotify-connect) to mention that user will need to set Redirect URIs accordingly based on the `login_redirect_uri` config option
Author
Owner

@ecabigting commented on GitHub (Aug 25, 2025):

I was having the same error till I add the login redirect URi. Now im getting this:

Image

I installed with this:
cargo install --git https://github.com/aome510/spotify-player.git --features media-control,fzf,notify

Any idea @aome510

<!-- gh-comment-id:3220415959 --> @ecabigting commented on GitHub (Aug 25, 2025): I was having the same error till I add the login redirect URi. Now im getting this: <img width="692" height="45" alt="Image" src="https://github.com/user-attachments/assets/9e1e6c15-6d4d-4c27-8b2a-543121de6d3f" /> I installed with this: cargo install --git https://github.com/aome510/spotify-player.git --features media-control,fzf,notify Any idea @aome510
Author
Owner

@aome510 commented on GitHub (Aug 25, 2025):

@ecabigting unfortunately not. This is the first time I see the above error

<!-- gh-comment-id:3220451210 --> @aome510 commented on GitHub (Aug 25, 2025): @ecabigting unfortunately not. This is the first time I see the above error
Author
Owner

@ecabigting commented on GitHub (Aug 25, 2025):

@ecabigting unfortunately not. This is the first time I see the above error

Oh. I tried with different features combination btw:

cargo install --git https://github.com/aome510/spotify-player.git --features image                                                                       
cargo install --git https://github.com/aome510/spotify-player.git --no-default-features --features pulseaudio-backend,streaming,media-control,fzf,notify 
cargo install --git https://github.com/aome510/spotify-player.git --features pulseaudio-backend,media-control,fzf,notify                                 
cargo install --git https://github.com/aome510/spotify-player.git --features media-control,fzf,notify                                                    

No luck. :(

This is on arch btw.

Weird enough. Since cannot for the life of me configure rust in my windows 11 machine. I compiled it with my wsl2 arch linux machine with cargo install --git https://github.com/aome510/spotify-player.git --features image didnt get any error. I had to add windows-gnu for rust. But its working ok on windows 11.

<!-- gh-comment-id:3220477930 --> @ecabigting commented on GitHub (Aug 25, 2025): > [@ecabigting](https://github.com/ecabigting) unfortunately not. This is the first time I see the above error Oh. I tried with different features combination btw: ```bash cargo install --git https://github.com/aome510/spotify-player.git --features image cargo install --git https://github.com/aome510/spotify-player.git --no-default-features --features pulseaudio-backend,streaming,media-control,fzf,notify cargo install --git https://github.com/aome510/spotify-player.git --features pulseaudio-backend,media-control,fzf,notify cargo install --git https://github.com/aome510/spotify-player.git --features media-control,fzf,notify ``` No luck. :( This is on arch btw. Weird enough. Since cannot for the life of me configure `rust` in my windows 11 machine. I compiled it with my wsl2 arch linux machine with `cargo install --git https://github.com/aome510/spotify-player.git --features image` didnt get any error. I had to add windows-gnu for rust. But its working ok on windows 11.
Author
Owner

@aome510 commented on GitHub (Aug 25, 2025):

Oh. I tried with different features combination btw:

I doubt it's a feature issue but likely something with your local setup. Hard to tell without further information. Can you open a separate issue instead and provide full log/backtrace? This doesn't seem related to the original issue reported here

<!-- gh-comment-id:3220519414 --> @aome510 commented on GitHub (Aug 25, 2025): > Oh. I tried with different features combination btw: I doubt it's a feature issue but likely something with your local setup. Hard to tell without further information. Can you open a separate issue instead and provide full log/backtrace? This doesn't seem related to the original issue reported here
Author
Owner

@SireBeef commented on GitHub (Aug 25, 2025):

Not sure if this is helpful, but I ran into this issue just now and wanted to add my experience as an extra datapoint.

What I noticed was that my previous redirect URIs that I had set up in my spotify-for-developers app dashboard were as follows:

http://localhost:8989/login
http://localhost:8989/callback

Then I came across this github issue and added http://127.0.0.1:8989/login and everything worked fine.

Our README links to https://developer.spotify.com/documentation/web-api/concepts/apps for info on spotify-connect and the instructions today are different than what was there in the past. I looked up the page and sure enough back in the day they referenced "localhost" as the example and today use "127.0.0.1" for redirect URIs instead. So at some point in the past "localhost" worked and now no longer does.

<!-- gh-comment-id:3220924119 --> @SireBeef commented on GitHub (Aug 25, 2025): Not sure if this is helpful, but I ran into this issue just now and wanted to add my experience as an extra datapoint. What I noticed was that my previous redirect URIs that I had set up in my spotify-for-developers app dashboard were as follows: http://localhost:8989/login http://localhost:8989/callback Then I came across this github issue and added http://127.0.0.1:8989/login and everything worked fine. Our README links to https://developer.spotify.com/documentation/web-api/concepts/apps for info on spotify-connect and the instructions today are different than what was there in the [past](https://web.archive.org/web/20250124160736/https://developer.spotify.com/documentation/web-api/concepts/apps). I looked up the page and sure enough back in the day they referenced "localhost" as the example and today use "127.0.0.1" for redirect URIs instead. So at some point in the past "localhost" worked and now no longer does.
Author
Owner

@KUHLwasStolen commented on GitHub (Aug 25, 2025):

Using localhost in the URIs is deprecated for new apps and will be soon for existing ones: https://developer.spotify.com/documentation/web-api/concepts/redirect_uri

<!-- gh-comment-id:3220973283 --> @KUHLwasStolen commented on GitHub (Aug 25, 2025): Using localhost in the URIs is deprecated for new apps and will be soon for existing ones: https://developer.spotify.com/documentation/web-api/concepts/redirect_uri
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#1416
No description provided.