mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #711] How to manually delete refresh token after it has been revoked by Spotify by a password change. #426
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#426
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 @kwakubiney on GitHub (Jul 25, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/711
So I changed my Spotify password and then, tried using the Spotify API but I kept getting hit with
error: invalid_grant, error_description: Refresh token revoked. I tried looking through the codebase to find an implementation which deletes this refresh token and replaces it with a new one after a new authorization code is gotten from spotify on a subsequent API request. I couldn't find a way around this although I have not really thought it through, I assumed there'll be an implementation for this in Spotipy.The code responsible for handling authorization code for access token and refresh tokenI expected Spotipy to delete old refresh token and create new one.
-Windows
@Peter-Schorn commented on GitHub (Jul 25, 2021):
What is the type of
oauth? Post the code where you create it.@kwakubiney commented on GitHub (Jul 25, 2021):
@Peter-Schorn
#Create session path with UUID
@Peter-Schorn commented on GitHub (Jul 25, 2021):
Just delete the cache file at
cache_path. That's where the token info is stored.@kwakubiney commented on GitHub (Jul 26, 2021):
@Peter-Schorn okay will try that.
@jac0b-w commented on GitHub (Jul 28, 2021):
I have had a similar issue where changing the API keys doesn't remove the existing cache and there's no easy way to detect if the API keys have changed just from the cache file. Is there an easier way to know if the cache is outdated/revoked or will I have to keep track of if the API keys have changed myself?
@Peter-Schorn commented on GitHub (Jul 28, 2021):
By "API keys" are you referring to the client id and client secret? If so, then it is your responsibility to maintain a separate cache file for each client id and client secret. If you don't then there will be no way to tell after the fact which client id and secret each cache file corresponds to. Remember, you can manually specify a path for the cache file.
@jac0b-w commented on GitHub (Jul 28, 2021):
Ah that makes sense. Any suggestions on how to name the cache file for each client id/client secret pair? My initial thought is to hash the keys to make it unique but there might be a better way.
@Peter-Schorn commented on GitHub (Jul 28, 2021):
How many different client ids and secrets do you have? You shouldn't need more than one.