Open medwards opened 3 years ago
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_ID
then 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 as SPOTIFY_APP_CLIENT_ID
and 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.
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 streaming
scope working and no others, I believe the streaming
scope 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 :)
Does this mean it's not possible to use librespot
with tokens generated using the Authorization Code Flow ?
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_ID
from 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.rs
that works off of these credentials instead of whats passed on the command line (see https://github.com/medwards/librespot/commit/fed29f4ceca9d4fedf49f251b1b7d9a0cdc74ed2).This works for the
streaming
scope: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
streaming
does):