[GH-ISSUE #14] get_cached_token() should check scopes too #6

Closed
opened 2026-02-27 23:20:21 +03:00 by kerem · 2 comments
Owner

Originally created by @tobkin on GitHub (Jul 6, 2014).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/14

Started playing with this library to learn Python, and I kept getting an "insufficient scope" error from Spotify.

It turns out that if your application gets issued a token, and the application's required scope changes to need more permissions before that token expires, get_cached_token() in oauth2.py will still give that token back even though Spotify will reject it. When tokens are cached, information about what scopes are associated with that token needs to be recorded too.

Originally created by @tobkin on GitHub (Jul 6, 2014). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/14 Started playing with this library to learn Python, and I kept getting an "insufficient scope" error from Spotify. It turns out that if your application gets issued a token, and the application's required scope changes to need more permissions before that token expires, get_cached_token() in oauth2.py will still give that token back even though Spotify will reject it. When tokens are cached, information about what scopes are associated with that token needs to be recorded too.
kerem closed this issue 2026-02-27 23:20:21 +03:00
Author
Owner

@plamere commented on GitHub (Jul 7, 2014):

thanks .. will fix soon. --p

<!-- gh-comment-id:48140835 --> @plamere commented on GitHub (Jul 7, 2014): thanks .. will fix soon. --p
Author
Owner

@plamere commented on GitHub (Jul 7, 2014):

fixed

<!-- gh-comment-id:48194309 --> @plamere commented on GitHub (Jul 7, 2014): fixed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#6
No description provided.