mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #244] Todo: Reverse engineer new Facebook login flow. #168
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#168
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 @devgianlu on GitHub (Sep 4, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/244
The Facebook login flow described in the docs is outdated. This is the result of visiting that endpoint:

@sashahilton00 commented on GitHub (Nov 8, 2018):
New URL client requests in browser is:
https://login2.spotify.com/login-facebook-sso/login?token=Ci0IARIpCInV-ojvLBIgjCK8h8zIv_ioJFP8FD2Nj1GpNARTIqF8Pb6WVtMLTJ0SILGE_PXbS48xP3YXkgTrY4ZfeGsq77r-F9LYsCIDiAiBwill take some further digging to work out exactly how it works, but my guess is that it opens up a websockets connection, requests a login token, then the server notifies the client once that token has an access token associated to it from the facebook auth callback. Anyone is welcome to poke around inside the Spotify client to work out what's going on, I will eventually get around to it, but it's low on the priorities list as i don't use facebook.
@sashahilton00 commented on GitHub (Nov 9, 2018):
Also, this login flow seems to be exclusive to the desktop app. Mobile app uses a different flow.
@sashahilton00 commented on GitHub (Nov 9, 2018):
Ok, so here's how the auth flow works:
https://login2.spotify.com/v1/configthat returns the following:login_url, which redirects to the Facebook login page.credentials_url, which returns202 Acceptedresponses whilst awaiting authentication. Once authenticated, thecredentials_urlreturns a200 OKresponse, with the following payload:where the
encoded_auth_blobis the base64 encoded auth blob.This behaviour shouldn't be particularly hard to implement in librespot. There are no API keys/special headers involved with the endpoint at the time of writing, so librespot could fairly easily adopt a
--fb-loginflag that retrieved the auth URL, printed it to console, then polled it until the auth was complete. I'd suggest a 5 minute cutoff for polling so as not to leave one instance of librespot endlessly polling if someone starts it and then doesn't authenticate, rather just panic if no auth received by then.I may get around to implementing this, but as mentioned previously, I don't use it, so it could be a while.
@devgianlu commented on GitHub (Nov 11, 2018):
Works nicely (librespot-org/librespot-java#16)! I'll leave up to you when to close this issue.
@sashahilton00 commented on GitHub (Nov 11, 2018):
Cheers, we'll leave this open for now. Currently Facebook auth isn't actually implemented in librespot, but it comes of the category of useful to have, hence will leave it here until it gets implemented at some point.
@medwards commented on GitHub (Feb 5, 2021):
Heads up: Sasha's analysis in https://github.com/librespot-org/librespot/issues/244#issuecomment-437406231 is no longer accurate, all of these URLs are now redirects to a deprecation notice page. (see https://github.com/hrkfdn/ncspot/issues/310 )
@sashahilton00 commented on GitHub (Feb 23, 2021):
If I get some time I'll take a look at the new process. I wish they'd stop fixing stuff that wasn't broken...