mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #754] get_token fails using credentials obtained through FB auth flow #406
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#406
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 @medwards on GitHub (May 24, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/754
I have credentials through a modified version of https://github.com/hrkfdn/ncspot/pull/537 that uses a newly created client id and client secret (
CLIENT_IDfrom here on out). These credentials authenticate:However librespot is unable to get a token using these credentials:
I have a hacked up version of
examples/get_token.rsthat works off of these credentials instead of whats passed on the command line (seegithub.com/medwards/librespot@fed29f4cec).This works for the
streamingscope:For any other scope or combination of scopes I get
MecuryError.I originally requested the following scopes when going through the oauth2 flow so I expect these to work (and mysteriously
streamingdoes):@medwards commented on GitHub (May 24, 2021):
I made https://github.com/medwards/ncspot/tree/env-client-secrets if you want to reproduce your own credentials. However while setting it up I realized I was using the normal Spotify client id with my own client secret. If I use my client id and client secret for
SPOTIFY_APP_CLIENT_IDthen I can still authenticate however I can't get a token for any token in this case (incl.streaming). If I use the spotify desktop app client id asSPOTIFY_APP_CLIENT_IDand my client secret then you get the behaviour I described in the main body of the issue.This might be expected behaviour, in which case feel free to close.
@sashahilton00 commented on GitHub (May 25, 2021):
It's possible that the keymaster endpoint simply doesn't support OAuth2 clients and their tokens. Given that this service is essentially an interop service that allows mercury clients to consume the HTTP endpoints protected by OAuth, the devs at Spotify may have not seen the point of supporting oauth sessions in the oauth token generating keymaster.
With regards to the
streamingscope working and no others, I believe thestreamingscope is required to interact with mercury endpoints. I may be wrong on this though.As for your client ID not working for streaming whilst Spotify's ID does work somewhat, it's possible that they do some form of whitelisting on their end.
It may be worth examining this behaviour further, but given the simplicity of the keymaster endpoint and what it does, combined with your observations around the behaviour with different client IDs, I'd place my bet on this being expected behaviour from Spotify servers rather than a bug, though the line is often blurred :)
@gdesmott commented on GitHub (Dec 30, 2022):
Does this mean it's not possible to use
librespotwith tokens generated using the Authorization Code Flow ?