Not refreshing access token automatically
See original GitHub issueEnvironment details
- OS: Windows 10 64x
- Node.js version: 12.16.3
- npm version: 6.14.4
googleapis
version: 59.0.0
Steps to reproduce
I expect the API to automatically refresh the access token on the next API call after it expires, but I only get an “Invalid Client” error. I can successfully access the API and upload/download google drive files until the access token expires, so I know the tokens I received from the API on first signin are valid. I have that same refresh token assigned to the oauth2client immediately before any request. I can verify that they are set via console.log. Is there some missing step to get the API to “automatically refresh the access token” as it says in the documentation?
oAuth2Client.setCredentials({
access_token: googleAccessToken,
refresh_token: googleRefreshToken
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:25 (6 by maintainers)
Top Results From Across the Web
Not able to refresh OAuth access token automatically
We are facing an issue related to the Freshdesk OAuth access token regeneration automatically. The APP does not authorize or perform OAuth 2.0 ......
Read more >What Are Refresh Tokens and How to Use Them Securely
This post will explore the concept of refresh tokens as defined by OAuth 2.0. We will learn how they compare to other token...
Read more >Solved: When to refresh an access token? - 391930
Hi all,. According to the docs, An access token, if not used, will expire in 24 hours. In addition, according to information from...
Read more >Should access tokens be refreshed automatically or manually?
Automatically Refreshing For every request that requires authentication/authorization, the user will send both tokens on the request headers. ...
Read more >Refresh Access Token | ReadyAPI Documentation
ReadyAPI automatically updates the access token using the refresh token. You need to click Refresh to update the access token using the refresh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there a preferred workaround until this is fixed?
How does this solve the issue if you did not change anything from the code he wrote?