- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Premium
Country
UA
Device
PC
Operating System
Windows 11
My Question or Issue
Hello, trying to do an automatic access token refresh, but for some reason when I do, the query returns an error to me: {"error": "invalid_grant", "error_description": "Invalid refresh token"}
My refresh token is 100% correct.
Here is my code to get the access token:
data = {
'grant_type': 'refresh_token',
'refresh_token': refresh_token,
'client_id': client_id,
}
headers = {
'Authorization': 'Basic ' + base64.urlsafe_b64encode(f'{client_id}:{client_secret}'.encode('ascii')).decode(),
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.post(token_url, data=data, headers=headers)
if response.status_code == 200:
oauth_token = response.json()['access_token']
Solved! Go to Solution.
Labels:
- Labels:
-
token
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page