Reputation: 5302
It seems that I need to wait for 60 minutes in order for my google token to expire. I am trying to test if my code on how to refresh my token is working, I don't have time to wait for 60 minutes just to test if it's working.
Is there a way to expire a google token manually so that i can test if my refresh token code is working?
Upvotes: 4
Views: 1266
Reputation: 481
By revoking access_token, you revoke the refresh_token too, docs :
The token can be an access token or a refresh token. If the token is an access token and it has a corresponding refresh token, the refresh token will also be revoked.
So there is no way to expire access_token and keep the refresh_token.
But you can test if the refresh_token is working with no need to expire access_token (you can have many access_token).
Else you can just check a status of your access_token on this url :
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=YOUR_TOKEN_HERE
And according to the return you refresh or not your access_token.
Upvotes: 5
Reputation: 13667
The URL https://accounts.google.com/o/oauth2/revoke?token={token}
should revoke it. documentation
If you're using the PHP gapi client, you should be able to call the function $client->revokeToken(token)
to have the client make that call for you.
Upvotes: -1