You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try creating a token through the spotify web console as found in the WebApihandler you'll get a 'Illegal scope' page
It appears that there's some scopes that can't be used together in a single token, and upon using that token in the spotify web api, as shown in /v1/me/player/devices endpoint does not work through /web-api/ #399, the spotify api simply returns the json model without any content, instead of an explicit error
The only solution that currently exists is to completely avoid using any /web-api/ endpoint without specifying X-Spotify-Scope, upon calling /web-api/ without X-Spotify-Scope, a token for ALL scopes is generated, without a way to force generate a new token
Potential solution
Remove implicit token generation, and require a X-Spotify-Scope or scope in the /token request, no need to tweak the token store. Tokens will still be stored and cached, and the first token with the needed scope will still be retrieved from the token store list. The only difference is users will need to explicitly add a scope to their /web-api/ request. The issue of unsupported combinations of scopes will still remain though, so a key-value map for token storage might be a better solution. /token could take a third optional parameter, it being the key for the token store map. By default the scope could be used as the key in the store
Version/Commit
v1.6.1
The text was updated successfully, but these errors were encountered:
The returned access token doesn't work, the Spotify API gives me the same result as reported, it seems like I was wrong with compatibility between multiple scopes. This appears to be related to the actual token generation.
This appears to be related to the actual token generation.
The API used for token generation is strictly an internal API which happens to work with the Web API sometimes.
What would be the best route to take? I notice the length of keys generated via the web-console is quite different than the one being generated by librespot-java, is this something I could debug further, or would it be best to lay certain endpoints aside?
WebApihandler
you'll get a 'Illegal scope' pageapi
, I could just use/tokens/{scope}
to request a specific token with just a singular scope, however, because a token is being generated implicitly with ALL possible scopes, the token returned by/tokens/{scope}
is the default token generated with all possible scopes, breaking certain/web-api/
endpoints, and/tokens
itself, becausegetToken
finds the first available token of the requested scope, which in this case is a token with ALL possible scopesThe only solution that currently exists is to completely avoid using any
/web-api/
endpoint without specifyingX-Spotify-Scope
, upon calling/web-api/
withoutX-Spotify-Scope
, a token for ALL scopes is generated, without a way to force generate a new tokenPotential solution
Remove implicit token generation, and require a
X-Spotify-Scope
orscope
in the/token
request, no need to tweak the token store. Tokens will still be stored and cached, and the first token with the needed scope will still be retrieved from the token store list. The only difference is users will need to explicitly add a scope to their/web-api/
request. The issue of unsupported combinations of scopes will still remain though, so a key-value map for token storage might be a better solution./token
could take a third optional parameter, it being the key for the token store map. By default the scope could be used as the key in the storeVersion/Commit
v1.6.1
The text was updated successfully, but these errors were encountered: