Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication failed: Bad credentials #520

Open
ManiArasteh opened this issue Jul 29, 2024 · 70 comments
Open

Authentication failed: Bad credentials #520

ManiArasteh opened this issue Jul 29, 2024 · 70 comments
Labels
bug Something isn't working

Comments

@ManiArasteh
Copy link
Contributor

Hi. I installed spotify-player but I get Bad credentials error.
I entered the correct username and password and I have Premium account, too, but it failed.
Can you help me fix this?

@GigaScratch
Copy link

Installed today (via aur/spotify-player-full-pipe 0.19.1-1) and am also getting this. Logs seem okay but also pretty empty aside from having a full config list.

2024-07-29T11:11:35.961162Z  INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "dracula", client_id: "65b708073fc0480ea92a077233ca87bd", client_port: 8080, player_event_hook_command: None, playback_format: "{status} {track} • {artists}\n{album}\n{metadata}", 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: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, cover_img_length: 9, cover_img_width: 5, cover_img_scale: 1.0, playback_window_width: 6, enable_media_control: true, enable_streaming: Always, enable_notify: true, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 70, bitrate: 320, audio_cache: false, normalization: false, autoplay: false }, notify_streaming_only: false, seek_duration_secs: 5 }, 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: VolumeUp }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeDown }, 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(' '))] }, 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: LyricPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('l'))] }, command: LyricPage }, 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: [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 }], 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, current_playing: None, page_desc: None, playlist_desc: None, table_header: None, selection: None, secondary_row: None } }] }, cache_folder: "/home/olivia/.cache/spotify-player" }
2024-07-29T11:11:35.962364Z  INFO spotify_player::auth: Creating a new session with new authentication credentials
2024-07-29T11:12:19.276628Z  WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials
2024-07-29T11:12:38.747635Z  WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials
2024-07-29T11:13:34.041577Z  WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials

@elipp
Copy link

elipp commented Jul 29, 2024

New user here - I also can't seem to be able to login.

Version: 0.19.1, installed via cargo install spotify_player.

Does this require a "Premium Individual" account? I have "Premium Family"

@aome510
Copy link
Owner

aome510 commented Jul 29, 2024

can reproduce by deleting my cached credentials. Not sure what has been changed recently. I will take a look later today.

@aome510 aome510 added the bug Something isn't working label Jul 29, 2024
@aome510
Copy link
Owner

aome510 commented Jul 29, 2024

It seems Spotify changed the authentication workflow that breaks the library spotify_player is using: librespot-org/librespot#1308. Let's monitor that thread to see how they gonna fix it.

@C4theBomb
Copy link

Hi, I'm here from NixOS where its also broken and I'm also looking for a fix. Read the above thread, its made some progress and they have a new method.

Just a summary of the associated conversation from the above thread.
Cause:
Spotify completely removed username&password authentication from the API through Hermes/Mercury.

Associated fix:
They have a proposed solution, and someone there has a working fix. They new fix switches to OAuth2 as their method of authentication.

Here is the new workflow that they are using: librespot-org/librespot#1308 (comment)

Associated changes to the librespot client: devgianlu/go-librespot@1e82a27

@Onotate
Copy link

Onotate commented Jul 31, 2024

Somehow it is working again..

@C4theBomb
Copy link

C4theBomb commented Jul 31, 2024

Same here. I'd keep watching for another 24 hours but if not this should be resolved @aome510. Spotify rolled back the code, though librespot is still planning on trying to switch to OAuth2 based auth.

@GigaScratch
Copy link

GigaScratch commented Jul 31, 2024

Working now for me as well.

Super nice they're prioritizing OAuth though, I am not keen on entering my login details directly, even if open source.

@elipp
Copy link

elipp commented Jul 31, 2024

Works for me too!

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Jul 31, 2024

I still have the same problem. Can you login?

@aome510
Copy link
Owner

aome510 commented Jul 31, 2024

works for me today too

@ManiArasteh
Copy link
Contributor Author

Not for me. I still having the problem. Did you do something?

@aome510
Copy link
Owner

aome510 commented Jul 31, 2024

no I didn't. Maybe Spotify rolled back the changes region by region, so it might take a while for your to be updated

@ManiArasteh
Copy link
Contributor Author

Ok. Waiting to apply the changes

@ManiArasteh
Copy link
Contributor Author

It's not working. But anyway, I close this issue.

@ManiArasteh
Copy link
Contributor Author

Still not working. I reopen this issue until the problem will be fixed.

@ManiArasteh ManiArasteh reopened this Aug 6, 2024
@ManiArasteh
Copy link
Contributor Author

Read this 👇

Developer of librespot got an email that the login method the library uses will not supported anymore in a few days. Shared in issue that @aome510 referenced.

@ecabigting
Copy link

can reproduce by deleting my cached credentials. Not sure what has been changed recently. I will take a look later today.

having the same issue, it was working this morning, but when I accidentally cleared my cached credentials, i cannot seem to login. Do we have any work arounds?

@luinbytes
Copy link

Can confirm still an issue also, worked fine yesterday and now auth is failing.

@ManiArasteh
Copy link
Contributor Author

Spotify removed authentication workflow completely. Now, what should we do? 😭

@casualNavigator
Copy link

casualNavigator commented Aug 13, 2024

Can confirm I have the same problem just today,

I'm on a Spotify Premium account, the credentials are correct --tested logging in using the official client and the web player.

I was using spotify-player cli as the controller and spotifyd as the device to stream to, but today both stopped working (I'm still on a Spotify Premium plan).

First I tried to resolve the issue with spotifyd:

I use the keyring option in the spotifyd config file spotifyd.conf, -so spotifyd gets the password from the keyring- which had no issue until today. So then tried setting the Spotify credentials manually for spotifyd, which also didn't work.

Ran spotfyd with spotifyd --no-daemon --debug-credentials,

I can see the output:

...
...
failed to connect to spotify: Login failed with reason: Bad credentials

Even though the credentials is indeed correct.

What worked for spotifyd was:

I had to remove all password entries from the spotifyd config file, which makes spotifyd use zeroconf authentification. This enabled the spotifyd device to be recognized from the official Spotify client and able to stream to it. (spotfyd is needed to run alongside the official Spotify client on the same machine -just for once for zeroconf authentification).

Now that spotifyd is being recognized by the official Spotify client, I deleted the spotify-player cli cache files in ~/.config/cache/spotify-player for a fresh slate, and ran spotify-player again, but got:

Failed to authenticate, 2 tries left

even through the credentials is correct.

Summary:

After setting spotifyd to use zerconf authentification, the spotifyd device is recognized on the official Spotify client and web player and is able be streamed to. But, spotify-player cli can't be run, as it is not able to authenticate even though the credentials are correct.

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 13, 2024

Maybe we can use another library or create an app called "applemusic-player" for using Apple Music in Terminal 😂

@repparw
Copy link

repparw commented Aug 14, 2024

I have the same problem after formatting my pc.
Is this affecting all new installs right now?
Did spotify provide a new auth method at least or something? Maybe something with client/secret keys?

@aome510 aome510 pinned this issue Aug 14, 2024
@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 15, 2024

IIs this affecting all new installs right now?

Yes. This affecting all new installs.

@norbeyandresg
Copy link

Same error here. Is there any workaround to authenticate while they fix the issue?

@ManiArasteh
Copy link
Contributor Author

Someone opened a PR for librespot. I wanna test it now.

@ManiArasteh
Copy link
Contributor Author

Please don't repeat instructions or giving a review. It will make this issue crowded.

@ManiArasteh
Copy link
Contributor Author

Hey @aome510, You can switch to rspotify. Because rspotify supports OAuth2, when I wanted to test spotify-tui, I saw that it uses OAuth2, with rspotify module

@aome510
Copy link
Owner

aome510 commented Aug 21, 2024

Hey @aome510, You can switch to rspotify. Because rspotify supports OAuth2, when I wanted to test spotify-tui, I saw that it uses OAuth2, with rspotify module

I do use rspotify in the app. librespot is used for bunch of different things, one of which is streaming. spotify-tui doesn't support streaming, so they can use rspotify exclusively.

@ManiArasteh
Copy link
Contributor Author

Hmm, OK

@brokoli18
Copy link

I did this, obtained the credentials file and put it into ~/.config/spotify-player. However when I start up spotify-client it still says: No cached credentials found, please authenticate the application first. I started the client specifically setting the cache directory with -c but it still didnt work. Am I missing something?

@chrisgrieser
Copy link

chrisgrieser commented Aug 22, 2024

Open the Spotify client and select "Example Speaker" as the output device

Tried to follow the instructions, but hit a roadblock with this step. Neither in the spotify web player, nor in the spotify app, does an Example Speaker ever show up for me. 🤔

guess it's back to spotify_tui for me until this issue resolved.

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 23, 2024

I did this, obtained the credentials file and put it into ~/.config/spotify-player. However when I start up spotify-client it still says: No cached credentials found, please authenticate the application first. I started the client specifically setting the cache directory with -c but it still didnt work. Am I missing something?

spotify-client or spotify_player?

@brokoli18
Copy link

spotify-client or spotify_player?

Pardon, I start up spotify_player

❯ spotify_player
No cached credentials found, please authenticate the application first.
Username:

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 24, 2024

I did this, obtained the credentials file and put it into ~/.config/spotify-player.

Hey, @brokoli18,
Put it in ~/.cache/spotify-player not ~/.config/spotify-player. spotify-player look for cached credentials in ~/.cache/spotify-player. If you put in that, spotify-player will ask you for authentication, which is broken with this method

@ManiArasteh
Copy link
Contributor Author

Fixed? or not?

@brokoli18
Copy link

@ManiArasteh That worked perfectly, thank you. I knew I was doing something silly 😆

@SirSerje
Copy link

Open the Spotify client and select "Example Speaker" as the output device

Tried to follow the instructions, but hit a roadblock with this step. Neither in the spotify web player, nor in the spotify app, does an Example Speaker ever show up for me. 🤔

guess it's back to spotify_tui for me until this issue resolved.

I just tried to user homebrew to install and this message appeared
Error: spotify-tui has been disabled because it uses deprecated `openssl@1.1`! It was disabled on 2024-02-12.

have you succeeded?

@chrisgrieser
Copy link

@SirSerje got the same message, I downloaded the spotify_tui from the github releases. Not perfect, but since it's only a temporary solution until spotify_player works again, I can live with it I guess :/

@ManiArasteh
Copy link
Contributor Author

Tried to follow the instructions, but hit a roadblock with this step. Neither in the spotify web player, nor in the spotify app, does an Example Speaker ever show up for me. 🤔

What? Turn off your firewall, then try again.

@mloskot
Copy link

mloskot commented Aug 27, 2024

I've found a simpler way, much simpler, IMO, than #520 (comment) fiddling librespot-auth and Spotify client:

  1. Install https://github.com/hrkfdn/ncspot
  2. Run ncspot and authenticate with it
  3. cp ~/.cache/ncspot/librespot/credentials.json ~/.cache/spotify-player/
  4. Run spotify_player and enjoy!

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 28, 2024 via email

@chrisgrieser
Copy link

Tried to follow the instructions, but hit a roadblock with this step. Neither in the spotify web player, nor in the spotify app, does an Example Speaker ever show up for me. 🤔

What? Turn off your firewall, then try again.

ah yes, that was it, thank you! Works now

@mloskot
Copy link

mloskot commented Aug 28, 2024

@ManiArasteh

Your simpler way does not work! 😂🤣

It does work for me. If it didn't, I would have not posted my comment to waste others' time.

p.s. No idea what's so LOL-ing about this - I thought it's a technical discussion, not kids party.

@ManiArasteh
Copy link
Contributor Author

It isn't working. Wait! What's your OS?

@mloskot
Copy link

mloskot commented Aug 28, 2024

Linux. I probably made a mistake assuming the use of cp and ~/.cache in my #520 (comment) will indicate that.

@ManiArasteh
Copy link
Contributor Author

OK, But I'm Windows.
Why everyone on GitHub have Linux?

@mloskot
Copy link

mloskot commented Aug 28, 2024

But I'm Windows.

You should have mentioned that crucial detail in the description of this issue!

"You put garbage in, you get garbage out"

@ManiArasteh
Copy link
Contributor Author

ManiArasteh commented Aug 29, 2024

I've found a simpler way, must simpler

Your must simpler way doesn't work 😂
https://github.com/user-attachments/assets/42af5404-6752-4417-ad66-888213a611af
Look at this video (Edit: No! Don't look. It's not complete).

@mloskot
Copy link

mloskot commented Aug 29, 2024

Your must simpler way...

I've corrected the typo. Thanks for pointing it out.

It does work, on Linux, otherwise I couldn't use this player what I've been successfully doing for a few days now.

@ManiArasteh
Copy link
Contributor Author

Do anyone have prebuilt binary for librespot-auth for Windows?

@ManiArasteh
Copy link
Contributor Author

Answer my question

@w-lfchen
Copy link

@ManiArasteh just a quick reminder that most people here are working/helping out on projects like this one without a profit incentive, out of the pure kindness of their hearts, something that you should reciprocate <3

on a more productive note, librespot-org/librespot#1309 has now been merged and they seem to be targeting a release next week according to this comment, so it seems like a proper solution for this can be worked on soon.

i just wanted to mention this here as it seemed relevant ^^

@ManiArasteh
Copy link
Contributor Author

@ManiArasteh just a quick reminder that most people here are working/helping out on projects like this one without a profit incentive, out of the pure kindness of their hearts, something that you should reciprocate <3

on a more productive note, librespot-org/librespot#1309 has now been merged and they seem to be targeting a release next week according to this comment, so it seems like a proper solution for this can be worked on soon.

i just wanted to mention this here as it seemed relevant ^^

Now that my subscription ended?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests