-
Notifications
You must be signed in to change notification settings - Fork 109
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
Spotify disabled username/password authentication #394
Comments
As already mentioned, this ultimately needs fixing in librespot. I have submitted a PR there to do that, hopefully it'll be merged when the maintainer has time. I'd appreciate review/feedback anyone has on that work but please don't hassle them there, everyone is busy and it's holiday season too - thanks Spotify! Once that (or something like it) is merged, we'll need to get support into gst-plugin-spotify. Depending what that support looks like, we may then also need to make changes to Mopidy-Spotify. As you can see, there are multiple projects involved so don't expect this to happen tomorrow. We could provide a custom build but I am reluctant because I'm not sure what gst-plugin-spotify will look like and I don't want to support another version of everything, even if it is short-term. In the meantime, there is a workaround. You ultimately need to obtain a "cached credentials" file and drop this into your Mopidy-Spotify data directory (typically
If you cannot use Spotify Connect for whatever reason, you can alternatively get a credentials.json file using the new OAuth flow feature in the dev librespot branch: |
I am getting this error when trying the last option: |
Does 'token' appear as an option when you run with
|
Looks like cloning the git was giving me the wrong version indeed. Grabbed the zip and that sorted it all out. Thanks, working great now. |
Thanks a lot for this quick fix. I retried the procedure without success, a bit weird... Is somebody experiencing a similar issue? PS : I guessed that values in mopidy.conf are not supposed to be removed (username, password, client_id, client_secret) |
The username and password fields won't actually be used once you've got a credentials.json in place. The client_id and client_secret might need updating if Spotify have reset your credentials? These are used by the |
Hi, |
No. You could try the gstreamer logs: |
Well done, I reset the values and that fixed the problem. Cheers |
Found my problem. Within mopidy.conf, I had the spotify login mail address but credentials.json contained the spotify username. Updated mopidy.conf and now its working. |
Oh, excellent find. Thanks |
Thanks @kingosticks for your work. Unfortunatly i can not get it to work. I created the credentials.json on a windows machine and copied it to a linked folder on my server, where mopidy runs in a docker container. |
I would guess it might need to be the same OS (e.g. windows, mac, Linux), because the client ID used to generate the credentials file is OS-specific. But that's a guess. |
As per my early comment with workarounds, if you can't use zeroconf on your server, use my forked version and do the oauth flow in headless mode |
no, they didn't. you just have to specify user-agent |
Great, thanks, that's super helpful. |
So steps for me to make this work were a combination of multiple things mentioned in this thread:
I hope this process can be simplified again at some point in the future because this was a bit of a hassle 😅 |
Hmm, has anyone else encountered Spotify flagging the mopidy connection as suspicious and resetting their password? The first time this happened it took a while and I didn't associate it with this method. But yesterday Spotify locked my account down within about 8 hours of setting this up. I'll try again, but am now discouraged. |
It's happened to some users of librespot (and us by extension) because our software is still using their now deprecated username and password authentication flow. It's pretty stupid they're doing this (they gave us very little notice and didn't mention they'd also do this), but that's Spotify for you.... I've now got token based auth working but it relies on code that's not yet merged/released upstream. Hence it's slow. But it's coming and then we'll be able to remove the need for username and password entirely. Which is great for everyone. Users that had working setups before should still be working because we've also been using "cached credentials", this login method is used in preference to user/pass auth. But I don't think it works for people with weird (Facebook) accounts where the username they log in with doesn't match their "real" Spotify username. This entire mess is an effort by Spotify to increase account security and we're doing our best to catch up. Personally I have no idea why anyone would want to steal Spotify account credentials, presumably nobody is refusing their passwords in 2024... If you're worried about using your account with Mopidy-Spotify, all the software is available to view and you can build gst-plugin-spotify yourself from source. Spotify themselves are incapable of offering software like this for whatever internal reasons, we're incredibly lucky to have alternatives to their client. But all those alternative clients are based around unofficial software (librespot and its clones). I don't think Spotify intended to scare anyone away from using librespot. After all, they did proactively reach out to the project with a heads-up about the upcoming change. I think they just make a lot of mistakes. |
I should also add, cached credentials will also not work if you've managed to configure Mopidy incorrectly. There is currently zero checking and logging of cached credentials usage so it's not obvious when this is happening. |
Thanks for the quick reply @kingosticks ... my discouragement was not fear of using my account with Mopidy-Spotify, but bothering to keep this clunker running with mopidy at all. Also, I think you're right ... I definitely have an OG "weird" Facebook account ID for my username, so that very well may be part of the calculus here. Thanks again for the help! |
I'm also looking forward to this clear, non-username/password auth ... Phonieboxes are down now for over a year for me ... |
I understand the frustration, but the auth problem is relatively recent. The issues in the project over the last few years have been due to all kinds of things. And that's inevitable when Spotify leaves us to reverse engineer everything, and changes stuff over time. I hope that fully moving to librespot, and me working on both (if only temporarily, I cannot keep this up) will help get us back on track. I think PhonieBox are also in a period of change so it's unfortunate timing. I did look at helping a while back but it seemed most of the focus was on their new, non-spotify flavour. Can look again when this is working and stable. I have a potential PhonieBox user of my own to motivate me. |
Just brainstorming here: I installed "Volumio" yesterday, which also is a Debian based MediaBox, but with a different focus than the Phonieboxes have.
I gave it a try and yes: You have to auth using Spotify's Standard-Auth mecha and don't have to create some ClientID and Secret manually; nor does it save the username or password. Spotify support has to be downloaded as a Plugin from here. From the filename, it looks "familiar": Maybe that's something that also is implementable in Phoniebox? |
That's cool. Although I have my own personal opinions on the value of fragmenting the eco system with yet another rewrite but there you go. Having zero compatibility/technIcal-debt is very nice to have. We should also be able to get rid of our client ID and secrets too also. That is a hangover from long ago, before Spotify support the oauth PKCE flow. See... isn't it nice to rewrite from scratch. I'm not actually jealous, that's a huge amount of effort. |
And what about spotify making login connection suspicions? I had to reset my password couple of times because spotify thinks we are doing something fishy. :) |
Ohhh, it's based on librespot-go. I take it all back, the developer is that has been around and helping for years. That's great news. |
@alanmilinovic as I said earlier:
The new version has that fixed. It'll be released soon. |
Very nice, happy to test it. |
Please put this in a separate issue. It does not belong here. |
I am very sorry to ask how to do all of this again, but I consider myself not being a complete IT-moron but yet, I can't get this to work, unfortunately. Since the librespot compile was missing these components, I then installed:
Next, I Installed Rust and Cargo (defaults applied): Using librespot commit Finally, I restarted the Pi. Navigating to What am I missing? Doesn't that new librespot version need to be installed in addition to a good |
@The-Judge happy to help you debug this if you move it over to: https://github.com/mopidy/mopidy-spotify/discussions/categories/q-a so we don't clog up this issue |
Fixed in Mopidy-Spotify v5.0.0a3 and gst-plugin-spotify_0.14.0~alpha.1-1. |
So how do you get this access token? Is that the
|
Bingo.
You just need to setup everything as the readme states. If it required extra steps, I would provide them. |
Ah ok, thanks. I'll wait for a proper release of |
It's currently blocked waiting for the librespot v0.5 release. Which is only blocked by one PR - it's close! |
Thank you for providing the workaround! We did have to stop using the module for the moment, even with the workaround, because Spotify would disable the credentials by the next day, and it just became really annoying to reset the password each time we used the module. And until now we also had to provide the username and password because that's what the module used for searching. |
The workaround is no longer necessary. The latest pre-release is fixed. Follow the instructions in the readme, including deleting any credentials.json file you may have been using. Username and password has only been required for playback for some time. We stopped using them for search approx 9 years ago. Now they're not required at all and I suggest removing them from your config. |
@PureTryOut In case you didn't already see, librespot v0.5 has been released, and latest gst-plugins-rs now supports it. |
Latest gst-plugins-rs being 0.13.2? That's been released 4 weeks ago already, are you sure that uses the last librespot? |
No, latest code in their repo. They can't backport it to 0.13.x because it requires a newer rust version. I'm not sure when 0.14.0 is due for actual release, sorry. |
Ouch ok, a bit more waiting then! |
Fixed in the latest pre-release and forked version of gst-plugin-spotify. Read all of the README for details.
Originally posted by @troyxmccall in #110 (comment)
Originally posted by @kingosticks in #110 (comment)
The text was updated successfully, but these errors were encountered: