hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.
BSD 2-Clause "Simplified" License
5.06k stars 211 forks source link

Bad Credentials #1500

Closed lm12000 closed 3 weeks ago

lm12000 commented 2 months ago

Describe the bug I can't login with my Spotify Family Account. I am assuming it has to do with the Account being a shared one in a Family Plan ? (Which is Premium.)

To Reproduce Steps to reproduce the behavior:

  1. Try Login.
  2. "Connection error: Login failed with reason: Bad Credentials"

Expected behavior Being able to use the application.

System (please complete the following information):

PS: I am really new to Linux so please forgive me if this is just a simple fix or something. I did try the actual username of the account as well as the email linked to it. Both did not work.

Apollo-XIV commented 2 months ago

having the same issue here, also on a family account. It's worked for me in the past but now doesn't, although I'm unsure of when that changed. I've checked multiple times and my password works through the browser and I'm confident I'm entering it correctly.

hrkfdn commented 2 months ago

It's probably related to this: https://github.com/librespot-org/librespot/issues/1308

Could be we need to change our login method

lm12000 commented 2 months ago

having the same issue here, also on a family account. It's worked for me in the past but now doesn't, although I'm unsure of when that changed. I've checked multiple times and my password works through the browser and I'm confident I'm entering it correctly.

This is exactly my problem as well. I was now somehow logged out of my spotify on my phone etc. too, which is strange. When I tried logging back in my password wasnt working anymore. I could eventually log back in over a link through email from spotify. Now I changed the password and it still does not work. Weird.

lm12000 commented 2 months ago

It's probably related to this: librespot-org/librespot#1308

Could be we need to change our login method

Ah I see, so its a bigger problem with the login method entirely, not just a Family Plan thing?

signaleleven commented 2 months ago

Seems like it was rolled out for different users at different times. I have a partner plan and I was also affected today (and Spotify Connect Home assistant addon, which uses librespot like ncspot - retried so much I got forced to change my password) whereas in the librespot issue it looks like it's being going on for over 2 months for other users.

I would follow the issue linked above :(

cyqsimon commented 2 months ago

Affected me today on a family plan. Seems like Spotify broke their own API.

geekmuse commented 2 months ago

Regular premium user here (no Family plan) and am experiencing the same issue.

jpringle1 commented 2 months ago

Installed ncspot for the first time today and ran into this issue. I assume i was doing something wrong, but it seems it might just be very unfortunate timing that this bug has cropped up just a few days before i tried to use this :/

donwlewis commented 2 months ago

Yup. I also ran into this issue.

psaumur commented 2 months ago

Am using a Family Plan and had ncspot working on Debian.

When I tried authenticating manually on Mint Edge, it failed a few times, until I copied over the credentials.json file from the working Debian instance.

After listening for a while, Spotify decided to reset my password so my credentials were no longer good.

Trying to reset my credentials for both Debian and Mint Edge have failed today.


Backtrace.log

   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: main
  13: <unknown>
  14: __libc_start_main
  15: <unknown>

panicked at /run/build/ncspot/cargo/vendor/librespot-core-0.4.2/src/connection/mod.rs:146:46:
EOF
RobinCamarasa commented 2 months ago

Same issue here using a Duo plan

tomasApo commented 2 months ago

Same issue here with family plan

psaumur commented 2 months ago

As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the credentials.json file, so I thinly wrapped just this functionality and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems.

Downloading the Linux Spotify client, running Dominic's Rust/Cargo application (link above) in the background, pulls out working credentials. Everything works again.

lm12000 commented 2 months ago

As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the credentials.json file, so I thinly wrapped just this functionality and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems.

Downloading the Linux Spotify client, running Dominic's Rust/Cargo application (link above) in the background, pulls out working credentials. Everything works again.

I tried this and got the credentials.json but after putting it in the .cache/ncspot/librespot as well as the .config/ncspot/credentials I still get prompted to put in my credentials at the login screen. Am I doing this wrong?

psaumur commented 2 months ago

I tried this and got the credentials.json but after putting it in the .cache/ncspot/librespot as well as the .config/ncspot/credentials I still get prompted to put in my credentials at the login screen. Am I doing this wrong?

Credentials, for ncspot, by default, go:

~/.var/app/io.github.hrkfdn.ncspot/cache/ncspot/librespot/

or wherever the "cache" path is when you type ncspot info + /librespot/

lm12000 commented 2 months ago

I tried this and got the credentials.json but after putting it in the .cache/ncspot/librespot as well as the .config/ncspot/credentials I still get prompted to put in my credentials at the login screen. Am I doing this wrong?

Credentials, for ncspot, by default, go:

~/.var/app/io.github.hrkfdn.ncspot/cache/ncspot/librespot/

or wherever the "cache" path is when you type ncspot info + /librespot/

Wow! thank you very much, that did work.

chocoblin commented 2 months ago

As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the credentials.json file, so I thinly wrapped just this functionality and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems.

Downloading the Linux Spotify client, running Dominic's Rust/Cargo application (link above) in the background, pulls out working credentials. Everything works again.

can you please write out the steps for a noob like me to follow? I don;t understand what to do to install librespot-auth even after going to that page

cyqsimon commented 2 months ago

@chocoblin git clone then cargo run. After that follow README.

Zardexd commented 2 months ago

Having this issue with app/dev.alextren.Spot/x86_64/stable flatpak too , just logged with same credentials from browser.

thecisco commented 2 months ago

@cyqsimon What exactly is git clone and cargo run? I just got into Linux and got the flatpak ver. of ncspot and I am having the same issue. Sorry for not being knowledgeable in these topics, that is why I must inquire.

cyqsimon commented 2 months ago

@cyqsimon What exactly is git clone and cargo run? I just got into Linux and got the flatpak ver. of ncspot and I am having the same issue. Sorry for not being knowledgeable in these topics, that is why I must inquire.

Use Google first please 🤦.

cyqsimon commented 2 months ago

Not trying to be condescending, but questions like these waste my time and yours. Mine because I could be doing something else; yours because there are plenty of answers online that do a better job than I ever could.

Zardexd commented 2 months ago

What exactly is git clone and cargo run? I just got into Linux and got the flatpak ver. of ncspot and I am having the same issue. Sorry for not being knowledgeable in these topics, that is why I must inquire.

Allows to clone (download) git repository. Repo's are used to store, collaborate and manage code changes.

Cargo is a package and build system for Rust programming language. Allows you to assemble a program from its sources (usually stored in repo's), or install packets/libraries that are used throughout the process of developing software.

Don't be afraid to google things, without it you can't really survive as newbie. Most of questions were already answered. Use Archwiki, other resources. And welcome to Linux

And about this credentials issue, just wait until devs fix everything, there is nothing you can do and most likely you did nothing wrong. Just sudden changes in spotify's API, and it broke things. Use web version for now, or official app.

roblox-model commented 2 months ago

For some reason librespot-auth's device doesnt appear / doesn't get recognized in the device list at all so i can't generate a credentials.json, could anyone send me a template on what the credentials.json contain and i'll try adding the stuff by myself please ?

psaumur commented 2 months ago

If you are not seeing it, it's prob. due to trying to run Spotify in a browser - instead of running the application directly in the Linux environment. I ran into this same issue and once I was running it locally, while running the "device" to pull credentials, it dumps the credentials out into the .json file

On Thu, Aug 29, 2024 at 9:33 AM ᲼ @.***> wrote:

For some reason librespot-auth's device doesnt appear / doesn't get recognized in the device list at all so i can't generate a credentials.json, could anyone send me a template on what the credentials.json contain and i'll try adding the stuff by myself please ?

— Reply to this email directly, view it on GitHub https://github.com/hrkfdn/ncspot/issues/1500#issuecomment-2318311803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZL3JZOTDK664IRQ2HUS523ZT5EO7AVCNFSM6AAAAABMM7R4RGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJYGMYTCOBQGM . You are receiving this because you commented.Message ID: @.***>

roblox-model commented 2 months ago

well i've tried running the application first, tried using the browser and even the app on my phone to see if airplay detected it but nothing appears, note that when i have both the application and the web player opened, the web player appears on the device list

Zocker1999NET commented 2 months ago

I seem not able to fully resolve (presumably) this issue fully at my system. I tried running ncspot 1.1.2, clearing .{cache,config}/ncspot and copied credentials.json as outputed by librespot-auth to .cache/ncspot/librespot.

I don’t get a "bad credentials" screen but I cannot play "new" titles, i.e. (I assume) which are not cached. Meaning with my state before, I can only play songs which I played before. And when I clear the cache, I cannot play anything. (Or is my issue different from this one?)

blessedbythestorm commented 2 months ago

@Zocker1999NET I'm getting the same. Generating the credentials from librespot-auth then copying them over to .cache/ncspot/librespot allows me to continue onto ncspot but I can't play any songs, it will just keep trying to play next until it finds a cached song. At the moment I can't really play any at all.

psaumur commented 2 months ago

@Zocker1999NET @blessedbythestorm

Credentials should be placed here:

~/.var/app/io.github.hrkfdn.ncspot/cache/ncspot/librespot (or wherever the USER_CACHE_PATH shows when you type 'ncspot info')

If you want to "refresh" ncspot's cache of your library, you can either rename or remove the "files" and "volume" folders in the same directory.

If you want to listen to NEW songs that are not in your playlists, you can using the Search function inside ncspot (F2).

Have been running this on Debian 12 and Linux Mint Edge without any of these issues.

blessedbythestorm commented 2 months ago

@psaumur In arch ncspot info yields ~/.cache/ncspot.

I had this working a few days ago with the librespot-auth workaround but then I think the credentials expired and now I can go into ncspot but cant play anything. I tried re authenticating to get new credentials but same results. I tried deleting .config/ncspot, .cache/ncspot and getting brand new credentials but same result.

https://github.com/user-attachments/assets/336da154-0b81-4da3-9aa9-8d5ffd86ee95

Zocker1999NET commented 2 months ago

TL;DR: I have basically the same experience as @blessedbythestorm shows in his last comment here. This also happens on me when trying to play back my saved tracks. Especially after clearing the cache directory, ncspot cannot play any of my 1000+ saved tracks.

answer to last message of @psaumur (i.e. [this last message](https://github.com/hrkfdn/ncspot/issues/1500#issuecomment-2327015086)) I think we have installed ncspot in different ways. From the path alone, I assume you installed ncspot using flatpak or something alike. I installed ncspot on NixOS from nixpkgs (version 1.1.2 from unstable) or downloaded & compiled it by myself on a Debian machine. > Credentials should be placed here: > > ~/.var/app/io.github.hrkfdn.ncspot/cache/ncspot/librespot (or wherever the USER_CACHE_PATH shows when you type 'ncspot info') Hence `ncspot info` in my case returns: ``` USER_CONFIGURATION_PATH /home/zocker/.config/ncspot USER_CACHE_PATH /home/zocker/.cache/ncspot USER_RUNTIME_PATH /run/user/1000/ncspot ``` > If you want to "refresh" ncspot's cache of your library, you can either rename or remove the "files" and "volume" folders in the same directory. As I mentioned before (probably it was not obvious), I already tried running ncspot with cleared cache directory. But then it seems I cannot play any song anymore. > If you want to listen to NEW songs that are not in your playlists, you can using the Search function inside ncspot (F2). In my comment, "new" referred to as in "not in cache". I tested ncspot by playing music back
psaumur commented 2 months ago

@Zocker1999NET I did, indeed, install it via Flatpak for both systems. Have you tried backing up your saved working credentials and reinstalling / recompiling the software? Does installing it via Flatpak make a difference?

When you use Spotify on the Desktop, do your credential still work or did they force you to update them? Wonder if Spotify changed something, yet again, and my credentials haven't timed out yet (created Aug. 18th, after it had broke)

As of today, my ncspot looks like a 1:1 of my Spotify account (which I am assuming is the desired behavior of the app) image

Denyreal commented 1 month ago

Not trying to be condescending, but questions like these waste my time and yours. Mine because I could be doing something else; yours because there are plenty of answers online that do a better job than I ever could.

it is the definition of condescending dude.

Joachim-42he commented 1 month ago

I have the same problem and have followed the librespot "workaround" to no avail. Before you ask: yes, I put the credentials.json in the right directory. After that, ncspot no longer asked me to login but just dies. I can`t see anything interesting in the debug log (attached) either. ncspot_debug.txt

hrkfdn commented 1 month ago

https://github.com/librespot-org/librespot/pull/1309#issuecomment-2348066427

With a little bit of luck we may have a working ncspot again next week :)

cartesius68 commented 1 month ago

Sorry to bother, just waiting to be allowed to run ncspot again. Do we know when logging in will be possible again?

yukihooked commented 1 month ago

ngl im about to crashout over this. I refreshed my oauth and now I can't even use this app anymore, I've tried compiling librespot myself, but the repository doesn't even have any new releases, and I would have to manually fork it. I just want to use this app again.

SOMEONE PLEASE FIX THIS, The explanation on how to refresh the OAuth token does NOT work.

hrkfdn commented 1 month ago

I have done some prep work in https://github.com/hrkfdn/ncspot/pull/1244, but haven't figured out the correct scopes yet. Also the librespot release isn't published yet, either.

cartesius68 commented 1 month ago

I have done some prep work in #1244, but haven't figured out the correct scopes yet. Also the librespot release isn't published yet, either.

Awesome and thanks for your hard work. This app is simply amazing, even nerds like me on FreeBSD are able to play music with it. Now, we're getting better at singing but hopefully everything will return to normal pretty soon. Again, big thanks!

hrkfdn commented 1 month ago

There is a first implementation in main. Happy to receive reports/fixes. If everything goes well I'll draft a release once librespot is released :)

Joachim-42he commented 1 month ago

Hm. Ncspot tells me to login via OAuth2 in my browser and after I have done that it tells me to return to the terminal but then nothing happens. It could be that my using i3-WM without a DE might lead to problems here.

hrkfdn commented 1 month ago

Are you running ncspot on the same computer as your browser? It needs to pass the token to localhost.

Joachim-42he commented 1 month ago

Yes I am. I have attached a debug log. ncspot.debug.txt

hrkfdn commented 1 month ago

That's odd. Looks like it has received the token and the logs indicate no problem either :confused:

BajekekButLost commented 1 month ago

hey, having the same issue here. I installed with winget and I cant log in with a Family plan account. Ik im late to this issue but as I read thru I still couldn't find anything that could fix my issue

hrkfdn commented 1 month ago

@BajekekButLost The fix isn't released yet.

lucasbeiler commented 1 month ago

Hm. Ncspot tells me to login via OAuth2 in my browser and after I have done that it tells me to return to the terminal but then nothing happens. It could be that my using i3-WM without a DE might lead to problems here.

Hi, @hrkfdn. On Friday morning I had the same issue as @Joachim-42he after building ncspot in the same way as the official Arch Linux PKGBUILD:

git clone https://github.com/hrkfdn/ncspot
cd ncspot
cargo fetch --locked
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release --features cover

Today, I just built it again, but simply with git clone https://github.com/hrkfdn/ncspot && cd ncspot && cargo build --release, and now it works perfectly. It might be due to the latest commit in the main branch since then that may have fixed the problem, or the way I built it on Friday uncovered some bug.

EDIT: Yes. When I build like I did on Friday, ncspot still exits when I try to open, even now. For now, simply building with git clone https://github.com/hrkfdn/ncspot && cd ncspot && cargo build --release is what fixed it for me. And it also seems that the problem is related with the --features cover build flag that I used back then.

psaumur commented 1 month ago

I just used "cargo run" and it worked. Glad it finally resolved for you using "cargo build"

On Sun, Sep 22, 2024 at 11:23 AM Lucas Beiler @.***> wrote:

Hm. Ncspot tells me to login via OAuth2 in my browser and after I have done that it tells me to return to the terminal but then nothing happens. It could be that my using i3-WM without a DE might lead to problems here.

Hi, @hrkfdn https://github.com/hrkfdn. On Friday morning I had the same issue as @Joachim-42he https://github.com/Joachim-42he after building ncspot in the same way as the official Arch Linux PKGBUILD:

git clone https://github.com/hrkfdn/ncspot cargo fetch --lockedexport RUSTUP_TOOLCHAIN=stableexport CARGO_TARGET_DIR=target cargo build --frozen --release --features cover

Today, I just built it again, but using git clone https://github.com/hrkfdn/ncspot && cargo build --release, and now it works perfectly. It might be due to the latest commit in the main branch since then that may have fixed the problem, or the way I built it on Friday uncovered some bug.

— Reply to this email directly, view it on GitHub https://github.com/hrkfdn/ncspot/issues/1500#issuecomment-2366903190, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZL3JZNXUJXGG6IZ7HP52WLZX4DI7AVCNFSM6AAAAABMM7R4RGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRWHEYDGMJZGA . You are receiving this because you were mentioned.Message ID: @.***>

hrkfdn commented 1 month ago

Thanks for the helpful reports, glad it's working :)

Drexxl-the-Walrus commented 1 month ago

For me neither cargo run nor starting after cargo build --release works. I just get this error after authentication:

"Failed to exchange code for access token (Server returned error response)"