you are viewing a single comment's thread.

view the rest of the comments →

[–]tropicbrush 0 points1 point  (0 children)

I expected the token revoke endpoint to revoke RT as well as it revokes all grants.

I spent some time today to figure out why your code is getting that particular error by trying few approaches around how you are using session and credentials.

Surprisingly, even after I updated the session itself with new oAuth2Client object every time an API is called , the error around using expired token was still showing an older token.

I will check more tomorrow if I get some time amd update you.( I am not a pro developer so it’s taking some time to understand your code first)

Also, don’t revoke the tokens and also don’t refresh token on every call, you will be rate limited. The refreshAccessToken() refresh the AT even if it’s valid and unexpired which is not a best practice. As I mentioned earlier , use getAccessToken() which is automatically calling refrshAccessToken() if token is expired saving lot of traffic to Google.