-
Notifications
You must be signed in to change notification settings - Fork 458
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
"Bad credentials" error when starting spotifyd #1293
Comments
Same here. It was working fine for months and stopped working this morning. Using configured username & password and have disabled zeroconf. I believe it's an issue with librespot as I get the same error with Raspotify. |
Hi! 🙂 Same thing, but I run
... then I get:
Nothing interesting with the verbose flag. |
Indeed something seems to have changed on the Spotify side, since I found already several reports (on several projects) which report the exact same error (most reports have been published recently). It started happening for me too, the issue persists when using the newest Anyway, for now what still should be working (from my tests) is discovery, so until this is fixed it might be a viable option for you? Issues in other projects: |
Hello all, same problem here too.
What do you mean by "discovery" ? |
Indeed, it still works with discovery.
See here: https://docs.spotifyd.rs/config/File.html#alternatives-to-storing-your-password-in-the-config-file Your device will be visible in spotify app as a player (probably requires same network for devices to work). |
Yeah, thanks for the clarification. For |
I can't get this to work, I've commented out |
It might be some firewall issue? Make sure you expose the ports 5353 UDP and the one that the logs say via TCP. |
I had to use the official Spotify client to first authenticate with zeroconf and then spotifyd became visible to other devices on the network. Just opening the official app was enough. |
FYI, as I mentioned on the librespot issue, The blob obtained via ZeroConf authentication flow is not tied to devices on the same network currently, and so for those wishing to reduce effort or network/mDNS config issues, simply running spotifyd on the same machine as a running official client for initial device registration, and then copying the credentials obtained to a remote machine where spotifyd is to be deployed, should work just fine. At least I tested it with librespot with no issues. |
@dspearson thanks for this, this explained why spotifyd suddenly stoped working today because of Bad Credential errors (?) I cannot find the blob ~/.cache/spotifyd nor ~/.config/spotifyd, is it stored here? |
@casualNavigator unfortunately I'm not a spotifyd user but taking a brief look at the code it uses librespot's crates directly so maybe try find on ~, looking for |
@casualNavigator in my case the credentials.json are stored in the cache_path location specified in config file ~/.config/spotifyd/spotifyd.conf |
Same issue on my end but I'm using raspotify. |
@dspearson and @casio1983 Thanks, found a I've tried to generate the curl -X POST "https://accounts.spotify.com/api/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=my-client-id&client_secret=my-client-secret" And updated the |
same issue here, and also i got an email from Spotify forcing me to change my password because they detected some "suspicious activity". (i really hope they are not killing spotifyd and other third-party clients...) |
Same here. Just migrated from raspotify to spotifyd and got that email. At least zeroconf works better in spotifyd. |
Discovery mode worked for me after I commented 'username' and 'password' out of the config file. |
Discovery works, but then plays via my phone not desktop via spotify-qt. user / password are still not working since yesterday. |
is there a workaround to authenticate with some saved credentials/token automatically? could spotifyd write some tokens to some file after a successful zeroconf authentication, which it could read at startup? the reason im asking is because my spotifyd disconnects after being idle for hours ( bugreported here #903 ) for which my workaround is to monitor/poll my active devices via the API and restart the spotifyd container whenever the API thinks its gone. ( commented here ) but since the username+password auth has been turned off on Spotify's side, whenever my container is restarted it wont belong to my account, so it will essentially get in a "bootloop" and i will need to do the zeroconf authentication each time (which is inconvenient). it would be nice if spotifyd persisted the tokens in some file which could be re-used until they are expired. |
There is a file called credentials.json in cache directory. There is some kind of key inside alongside username. Check if that directory is not wiped out on docker down action. It works for at least couple of hours and it's visible in spotify app after device restart. I compiled Spotifyd from source, it's running a system service under Ubuntu. |
You can use the cached discovery credentials for a long time. I've used mine for weeks now. Like previously mentioned, just make sure they're not deleted in your workflow. |
Same or similar problem here with spotifyd 0.3.5 on Ubuntu 22.04.4:
I also tried discovery mode by commenting out username and password in spotifyd.conf, but it seems to be stuck. I don't think I have a credentials.json anywhere because I've not used spotifyd on this computer before, only at work, where it worked fine (haven't tried these past weeks): Additional question. Do I need a credentials.json for discovery to work and can I create one myself?
and it just stays there (+10 min), nothing happens, and I have to interrupt the process. I've n-ple (n>>2) checked the username and password as well as tried both with conf and CLI (-u, -p) with and without " and/or '. I also changed/updated my spotify password and it has no "problematic" characters such as spaces or ". |
For those that seem to have issues creating the credentials.json file, I have created the following: https://github.com/dspearson/librespot-auth Build with
|
is that using of a manually created credentials.json a workaround to get spotifyd in zeroconf mode running? Has someone positive results in using it? |
It works. After confirming authorization for "Example Speaker" in the spotify client, copy the generated |
@dspearson Worked, flawlessly! Built it in Rust to too, what an absolute Chadman! @Mike-de-bike Confirmed working, was able to use spotifyd and spotify-player again. |
Just wanted to add here #1285 that if you have 2 IP address on your interface you may have issues with discovery. |
I'm afraid the only way to finally solve this problem in spotifyd is to switch to OAuth authentication (as librespot already did in dev branch). |
Nope, not working. Tried to use provided librespot package, tried build it myself. Spotify app doesn't see any devices, through it only shows other devices with official clients. |
After some time, I remembered that similar issues were due to the firewall. And this was mentioned above. I didn't know which port librespot-auth uses, or is it require something else. So, I just stopped So anyone having problems with missing devices in spotify client, better check firewall setting. Thank you. |
Hello, thank you! I followed the steps, and it finally started working again. |
EDIT: nevermind, I was able to do it with the phone as I’m on the same network. |
I know, and it wasn’t showing up there; I really had to go through my phone to get it. I’m not sure why, at least it worked. :) |
FWIW, |
I simply tried to rebuild spotifyd after changing the "0.4" to "0.5" for librespot dependencies in the Cargo.toml (hey, it was worth a shot), but it does not work...
Which to me sounds like we're on the right track. Meanwhile, I'm affraid the solution won't come from me : I never wrote a single line of Rust and I gave pretty much everything I got on this "search and replace" in the Cargo.toml ;-) |
Just a quick heads up: I'm basically done with bumping librespot to the new version, just some dbus MPRIS stuff is still missing, where I'm working on getting rid of the web API requests completely. I hope to get it done within the next couple of days, however if you'd like to help testing or can't wait (and don't need DBus for your setup), I published the current state here. |
Tried the branch you recommended but I sadly still get the "bad credentials" error. |
Yes, the broken user-password auth is still the one used in that branch (the new OAuth way needs to be adapted from upstream first). |
Hi @eladyn thank you for working on this issue. When do you think the fixed version will come to Arch packages? |
Usually, Arch should be quite fast, once we release the new version. But since that hasn't happened yet, it'll take a couple of days at least before that. |
Bumping this issue. I have tried everything in this thread and still cannot resolve the Bad Credentials error. |
I've never used it before so I don't have a credentials file, and I tried creating one but it does not like the format. Does anyone has an example of the shape of the json file? |
{"username":"redacted","auth_type":1,"auth_data":"redacted"} |
if someone have fixed this issue or solved it help me get it working please |
Here, I found a simple way to solve this problem with https://github.com/aome510/spotify-player. Hope it helps.
Now, run |
I've also just encountered this issue and I tried to solve it by using zeroconf. So I basically just left my username and password field blank and to my understanding, the first client that connects basically passes on its saved credentials. However, when I tried to connect to the device, the addon crashed and I got this error:
I solved it by adding this line to /etc/hosts
No idea if this helps anyone, just thought I'd mention it. |
Heads up -- this misses a trailing - username_cmd = "cp /home/user_name/.cache/spotify-player/credentials.json /home/user_name/.cache/spotifyd && jq -r .username /home/user_name/.cache/spotifyd/credentials.json"
+ username_cmd = "cp /home/user_name/.cache/spotify-player/credentials.json /home/user_name/.cache/spotifyd/ && jq -r .username /home/user_name/.cache/spotifyd/credentials.json" You would also need to create the |
Trying the workaround, I'm able to get quite far, however ultimately I'm getting this error:
|
I also had some problems with this. Usually I use ncspot for my spotify needs but it doesn´t work properly atm so I had to install spotifyd. I got it working with a combination of solutions provided here.
cache_path = "/home/user_name/.cache/spotifyd"
Thanks to MiuKaShi, kingofsquirrel and CompeyDev |
Why --no-daemon? What difference does it make?
…On Thu, 26 Dec 2024 at 07:53, Boxer66 ***@***.***> wrote:
I also had some problems with this. Usually I use ncspot for my spotify
needs but it doesn´t work properly atm so I had to install spotifyd.
I got it working with a combination of solutions provided here.
I use librespot 0.60 on a EndeavourOS laptop with i3-wm. I am a spotify
premium user.
1.
Edit /etc/hosts and add this line
0.0.0.0 apresolve.spotify.com
2.
Create the ~/.cache/spotifyd folder
3.
install and start spotify-player to create credentials.json
4.
Set cache_path and username_cmd in spotifyd.conf as follows (replace
user_name with your name)
cache_path = "/home/user_name/.cache/spotifyd"
username_cmd = "cp /home/user_name/.cache/spotify-player/credentials.json
/home/user_name/.cache/spotifyd/ && jq -r .username
/home/user_name/.cache/spotifyd/credentials.json" and comment out password
= ""
6. run spotifyd --no-daemon --verbose
7. You can now use spotify-player or in my case I use spotify-tui
8. I also edited spotifyd.conf and commented out use-keyring and
password_cmd
Thanks to MiuKaShi <https://github.com/MiuKaShi>, kingofsquirrel
<https://github.com/kingofsquirrel> and CompeyDev
<https://github.com/CompeyDev>
2024-12-26-07_41_46-screenshot.png (view on web)
<https://github.com/user-attachments/assets/2bc02496-a698-4189-a192-de138c5c09d7>
2024-12-26-07_46_18-screenshot.png (view on web)
<https://github.com/user-attachments/assets/b07fd3d2-76e1-4a2a-832f-7794e569eddf>
—
Reply to this email directly, view it on GitHub
<#1293 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXW5BAP4A55MZE2SX4M53QL2HORVVAVCNFSM6AAAAABLUNHASSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRSGIZDIMBUGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I finally got around to implementing OAuth support in |
Description
I've been using spotifyd for a few years now without issue. Just this morning when trying to connect, I got the following error:
I am able to login just fine on all my other devices, it's only using
spotifyd
where I have this issue. I have also tried restarting my PC, and using my email as username instead of the username string, as suggested by #1269, but neither have worked.To Reproduce
spotifyd --verbose --no-daemon
Expected behavior
spotifyd
should authenticate with spotifyLogs
Click to show logs
Compilation flags
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: