mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #802] Authentication Error #1411
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#1411
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @houdini-21 on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/802
Describe the bug
The player cannot obtain a new authentication token from Spotify, causing all API requests to fail with the message
Token is not valid. The log shows multiple403errors when trying to access the endpointhm://keymaster/token/authenticated.To Reproduce
spotify-playerwith default configuration.Expected behaviour
The player should successfully authenticate with Spotify, obtain a valid token, and allow music playback or library access without errors.
Log and backtrace
Relevant log excerpt:
Screenshots

Environment
Additional context
librespot, specifically when obtaining the token with certain scopes from thekeymasterendpoint.client_idused, or a bug in the library handling authentication.@VuillaumeXB commented on GitHub (Aug 12, 2025):
Same issue here, on Arch Linux as well
@H4ckN3rd commented on GitHub (Aug 12, 2025):
Same here on Fedora, pretty sure it’s a Spotify-side issue, not the OS or client, since Ncspot’s busted too. #801
@juliusdelta commented on GitHub (Aug 12, 2025):
Same issue here on Arch Linux.
@juliusdelta commented on GitHub (Aug 12, 2025):
I've opened an issue in the librespot repo for this issue https://github.com/librespot-org/librespot/issues/1532
@kvndl commented on GitHub (Aug 12, 2025):
Same issue here on Fedora 41 - slightly different token logs since I've already tried re-authenticating
FWIW I've also been using the host workaround on this machine:
0.0.0.0 apresolve.spotify.com@aome510 commented on GitHub (Aug 12, 2025):
Well I guess spotify devs really like to break things. Maybe it's a way to force people to use their proprietary app 🤷♂️
@makzef commented on GitHub (Aug 12, 2025):
Perhaps the devs are messing around with authorization again. I tried to log in to open.spotify.com, and instead of the usual login and password, there was a login and confirmation code sent to my email by default (but there was an option with password). I don't remember that was a thing before.
@bbzylstra commented on GitHub (Aug 12, 2025):
I forked spotify_player and moved the token acquisition to login5 per (https://github.com/librespot-org/librespot/issues/1532) as well as integrated the audio fix workaround from https://github.com/aome510/spotify-player/issues/796#issuecomment-3162984574:
https://github.com/bbzylstra/spotify-player
The commands to patch are pretty much identical to @KUHLwasStolen https://github.com/aome510/spotify-player/issues/796#issuecomment-3162984574:
@ashes00 commented on GitHub (Aug 12, 2025):
Issue present on Ubuntu 24.04 Desktop as well.
@houdini-21 commented on GitHub (Aug 13, 2025):
This work for me!!! 🥇
@Cxderzz commented on GitHub (Aug 13, 2025):
This worked for me, consider opening a PR?
@tbiswas97 commented on GitHub (Aug 13, 2025):
Issue present on MacOS as well, https://github.com/bbzylstra/spotify-player fork didn't resolve it
@KUHLwasStolen commented on GitHub (Aug 13, 2025):
I think we should wait until
librespothas an official release that either addresses this or deprecates the the current acquisition method.Also, AFAIK, we cannot publish to crates.io or similar if there is a git-dependency in
Cargo.toml@Cxderzz commented on GitHub (Aug 13, 2025):
Makes sense, thank you
@tungstengmd commented on GitHub (Aug 13, 2025):
i thought it was just me suffering, glad to know that's not the case and pissed that it's an issue at all. i'd download my songs but that's ~1.5k songs and idk if i have the space
@Fireye04 commented on GitHub (Aug 14, 2025):
This fix is working for me on arch, thanks!
@n-connect commented on GitHub (Aug 14, 2025):
Thx, with slight changes it worked for me. The key one was changing from pulseaudio to rodio-backend. Others are nice to have
cargo install --path spotify_player/ --no-default-features --features rodio-backend,image,streaming,media-control,notify@Douglas019BR commented on GitHub (Aug 14, 2025):
Thanks
Works for me on Ubuntu 24.04.3 LTS x86_64!
Please open a PR with this changes
@Alexander3a commented on GitHub (Aug 14, 2025):
he cant rust cargo does not allow depending on git we need to wait for librespot to update or publish our own librespot fork
@emilystgeist commented on GitHub (Aug 14, 2025):
oh my god that fork worked for me on arch. what a relief
@szaffarano commented on GitHub (Aug 15, 2025):
Nix overlay, applies @bbzylstra patch using the librespot
devbranch@adamzwakk commented on GitHub (Aug 15, 2025):
Thanks for this! Works perfect for my nix setup
@aniruddhgutta commented on GitHub (Aug 17, 2025):
I thought I'd fixed the issue until I saw this today -
`Error: initialize new Spotify session
Caused by:
0: new streaming connection
1: initialize spirc
2: Requested entity was not found { no native root CA certificates found (errors: []) }`
Here are the logs
2025-08-17T14:00:37.823117Z INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "dracula", client_id: "e1ec19db5c9447ff91147655eb6b3600", client_id_command: None, client_port: 8080, login_redirect_uri: "http://127.0.0.1:8989/login", player_event_hook_command: None, playback_format: "{status} {track} • {artists} {liked}\n{album}\n{metadata}", playback_metadata_fields: ["repeat", "shuffle", "volume", "device"], notify_format: NotifyFormat { summary: "{track} • {artists}", body: "{album}" }, notify_timeout_in_secs: 0, tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, play_icon: "\u{f04c}", pause_icon: "\u{f04b}", liked_icon: "\u{f004}", border_type: Plain, progress_bar_type: Rectangle, layout: LayoutConfig { library: LibraryLayoutConfig { playlist_percent: 40, album_percent: 40 }, playback_window_position: Bottom, playback_window_height: 6 }, cover_img_length: 9, cover_img_width: 5, cover_img_scale: 1.0, enable_media_control: true, enable_streaming: Always, enable_notify: true, enable_cover_image_cache: true, default_device: "akira", device: DeviceConfig { name: "void", device_type: "computer", volume: 100, bitrate: 320, audio_cache: true, normalization: false, autoplay: true }, notify_streaming_only: false, seek_duration_secs: 5, sort_artist_albums_by_type: false }, keymap_config: KeymapConfig { keymaps: [Keymap { key_sequence: KeySequence { keys: [None(Char('n'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('p'))] }, command: PreviousTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('.'))] }, command: PlayRandom }, Keymap { key_sequence: KeySequence { keys: [None(Char(' '))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [Alt(Char('r'))] }, command: ToggleFakeTrackRepeatMode }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('s'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('+'))] }, command: VolumeChange { offset: 5 } }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeChange { offset: -5 } }, Keymap { key_sequence: KeySequence { keys: [None(Char('_'))] }, command: Mute }, Keymap { key_sequence: KeySequence { keys: [None(Char('>'))] }, command: SeekForward }, Keymap { key_sequence: KeySequence { keys: [None(Char('<'))] }, command: SeekBackward }, Keymap { key_sequence: KeySequence { keys: [None(Enter)] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('r'))] }, command: RefreshPlayback }, Keymap { key_sequence: KeySequence { keys: [None(Char('/'))] }, command: Search }, Keymap { key_sequence: KeySequence { keys: [None(Char('z'))] }, command: Queue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [None(Char('Z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('g'))] }, command: JumpToHighlightTrackInContext }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char(' '))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('a'))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('a'))] }, command: ShowActionsOnCurrentTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('R'))] }, command: RestartIntegratedClient }, Keymap { key_sequence: KeySequence { keys: [None(Tab)] }, command: FocusNextWindow }, Keymap { key_sequence: KeySequence { keys: [None(BackTab)] }, command: FocusPreviousWindow }, Keymap { key_sequence: KeySequence { keys: [None(Char('T'))] }, command: SwitchTheme }, Keymap { key_sequence: KeySequence { keys: [None(Char('D'))] }, command: SwitchDevice }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('p'))] }, command: BrowseUserPlaylists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('a'))] }, command: BrowseUserFollowedArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('A'))] }, command: BrowseUserSavedAlbums }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char(' '))] }, command: CurrentlyPlayingContextPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('t'))] }, command: TopTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('r'))] }, command: RecentlyPlayedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('y'))] }, command: LikedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('L'))] }, command: LyricsPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('l'))] }, command: LyricsPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('l'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('s'))] }, command: SearchPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('b'))] }, command: BrowsePage }, Keymap { key_sequence: KeySequence { keys: [None(Backspace)] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('q'))] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('O'))] }, command: OpenSpotifyLinkFromClipboard }, Keymap { key_sequence: KeySequence { keys: [None(Char('?'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('h'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [None(Char('q'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('c'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [None(Esc)] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('j'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('n'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Down)] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('k'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('p'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Up)] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageUp)] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('b'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageDown)] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('f'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('g'))] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Home)] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Char('G'))] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(End)] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('t'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('a'))] }, command: SortTrackByArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('A'))] }, command: SortTrackByAlbum }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('d'))] }, command: SortTrackByDuration }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('D'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('r'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('l')), None(Char('a'))] }, command: SortLibraryAlphabetically }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('l')), None(Char('r'))] }, command: SortLibraryByRecent }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('k'))] }, command: MovePlaylistItemUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('j'))] }, command: MovePlaylistItemDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('N'))] }, command: CreatePlaylist }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('c'))] }, command: JumpToCurrentTrackInContext }], actions: [] }, theme_config: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: Blue }, cyan: Color { color: Cyan }, green: Color { color: Green }, magenta: Color { color: Magenta }, red: Color { color: Red }, white: Color { color: Gray }, yellow: Color { color: Yellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: LightRed }, bright_magenta: Color { color: LightMagenta }, bright_green: Color { color: LightGreen }, bright_cyan: Color { color: LightCyan }, bright_blue: Color { color: LightBlue }, bright_yellow: Color { color: LightYellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_status: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, playback_progress_bar_unfilled: None, current_playing: None, page_desc: None, playlist_desc: None, table_header: None, selection: None, secondary_row: None, like: None, lyrics_played: None, lyrics_playing: None } }] }, cache_folder: "/home/vye/.cache/spotify-player" } 2025-08-17T14:00:37.846382Z INFO librespot_oauth: OAuth server listening on 127.0.0.1:8989 2025-08-17T14:00:44.815843Z INFO spotify_player::streaming: Application's connect configurations: ConnectConfig { name: "void", device_type: Computer, is_group: false, initial_volume: 65535, disable_volume: false, volume_steps: 64 } 2025-08-17T14:00:44.815900Z INFO librespot_playback::mixer::softmixer: Mixing with softvol and volume control: Log(60.0) 2025-08-17T14:00:44.815943Z INFO spotify_player::streaming: Initializing a new integrated player with device_id=abcbd3bc-eb88-47d9-93a1-940aac37a3e8 2025-08-17T14:00:44.816018Z INFO spotify_player::streaming: Starting an integrated Spotify player using librespot's spirc protocol 2025-08-17T14:00:44.816044Z INFO librespot_playback::convert: Converting with ditherer: tpdf 2025-08-17T14:00:44.816083Z INFO librespot_playback::audio_backend::rodio: Using Rodio sink with format S16 and cpal host: ALSA 2025-08-17T14:00:44.816091Z INFO librespot_playback::audio_backend::rodio: Using audio device: defaultBuilt with the following features -
--no-default-features --features rodio-backend,streaming,media-control,daemon,notify,sixel,fzfI already tried fixing this by removing the cached credentials as mentioned in this issue - https://github.com/aome510/spotify-player/issues/688, but it didn't work
(I didn't know if this was relevant to this issue or is new, also this is my first time raising an issue so forgive me for any mistakes on my part)
@gand0rf commented on GitHub (Aug 17, 2025):
@bbzylstra Thanks for that!!! Issue on Xubuntu 24.04.
@n-connect Used your feature options. Really do like these features!!
@hosackm commented on GitHub (Aug 20, 2025):
@bbzylstra thanks for the patch. Works on Mac OS for me.
@wdoekes commented on GitHub (Aug 20, 2025):
@aniruddhgutta I also saw a similar error, even after succesful auth:
I built spotify-player per https://github.com/aome510/spotify-player/issues/802#issuecomment-3181391316 (@bbzylstra), cleared my
.cacheand.config. Clearing (something in) the cache dir was necessary. After that, it worked.@aniruddhgutta commented on GitHub (Aug 20, 2025):
@wdoekes hmm weird, I already cleared my
.cacheand.configprior to rebuilding spotify-player and cleared it after building it too, still doesn't fix the issue though@Jafeth12 commented on GitHub (Aug 21, 2025):
thanks for this man. consider opening pr with this please!
@bbzylstra commented on GitHub (Aug 21, 2025):
@aniruddhgutta I think you must have some .config files somewhere. Your logs show that the client_id is different than what it should be. You have e1ec19db5c9447ff91147655eb6b3600 when it should be 65b708073fc0480ea92a077233ca87bd.
@aniruddhgutta commented on GitHub (Aug 21, 2025):
Yes I was using my own client id but I also tried it without any config too and it still throws the same error, I would send the logs but I'm not on my pc rn
@bbzylstra commented on GitHub (Aug 21, 2025):
@aniruddhgutta I'd check that you have
ca-certificatesinstalled via your package manager, or if you already have this package you can try runningupdate-ca-certificatesinstead. I tried to replicate your error on my system without these packages but I couldn't. It seems to be an issue with tokio-tungstenite not being able to find your root CA certificates. I created a branch in my repo calledca-fixthat uses therustls-tls-webpki-rootsinstead of your native ones to hopefully fix the issue. You can get the code via:No idea if this will fix your issue since I can't replicate it, but I think the error points to something going on with your system configuration.
@ghost commented on GitHub (Aug 22, 2025):
same issue on nixOS...
@Fireye04 commented on GitHub (Aug 22, 2025):
szaffarano's nix overlay (https://github.com/aome510/spotify-player/issues/802#issuecomment-3191659178) worked great for me on nixos (though devices still aren't shown).
@aniruddhgutta commented on GitHub (Aug 22, 2025):
@bbzylstra Wow thanks for the fix!! It finally works though I had to change librespot's version in Cargo.lock
but yes now it finally works, tysm!!
@ecabigting commented on GitHub (Aug 22, 2025):
@aome510 will we get a new version as well when librespot release its fixes and new versions base from this thread #1544
@saforem2 commented on GitHub (Aug 22, 2025):
This worked for me as well on MacOS
🙌 thank you @bbzylstra
@Fireye04 commented on GitHub (Aug 24, 2025):
Looks like we have that libspot release! https://github.com/librespot-org/librespot/issues/1544#issuecomment-3218181864
@aome510 commented on GitHub (Aug 24, 2025):
Nice!! I will look into updating today to see if it fixes all the issues we are seeing
@bbzylstra commented on GitHub (Aug 24, 2025):
I updated my patch to use the "0.7.0" release, it compiled fine and works. The main issue is that the new login5 token does not support custom client_ids so the devices won't show up. https://github.com/aome510/spotify-player/issues/804#issuecomment-3217261646
@aniruddhgutta commented on GitHub (Aug 24, 2025):
@bbzylstra ohhhh so thats why my devices weren't showing up, I was kinda confused for a bit
so is there like no way of using custom client ids from now?
@bbzylstra commented on GitHub (Aug 24, 2025):
@aniruddhgutta unfortunately not. I've been working on a fix but it requires either a pretty substantial rewrite of librespot to use the oauth token flow, or have spotify-player juggle two separate tokens (login5 for librespot and oauth for rspotify device commands). The other problem with oauth is that you need to handle both the access token and the refresh token in the cache.
See: https://github.com/librespot-org/librespot/issues/1532#issuecomment-3187452377 and https://github.com/librespot-org/librespot/issues/1532#issuecomment-3187943782
Spotify oauth flow: https://developer.spotify.com/documentation/web-api/tutorials/refreshing-tokens
@aome510 commented on GitHub (Aug 24, 2025):
spotify_playernow upgrades to use librespot0.7.0after #808, which I can confirm fixing both the audio and authentication issues for me. Thanks @bbzylstra for putting up the original upgrade PR.The downside (as mentioned in the above comment) is that it no longer supports getting token with a custom
client_idwhich the app uses to implement Spotify Connect functionality. I won't put up a new release until I figure out how to bring back Spotify Connect feature as well as reviewing a few ongoing PRs that I haven't had chance to look at.In the meantime, please use the latest
masterinstead if you encounter any authentication or audio issues. For example,@tifandotme commented on GitHub (Aug 27, 2025):
when will this be released in homebrew?
@aome510 commented on GitHub (Aug 27, 2025):
I plan to release a new version this weekend. Will also need to wait for librespot to release a new version
0.7.1with patches