New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check if my referesh access token is expired or not #1328
Comments
I beleive (but am not 100% sure) that refresh tokens do not expire so that you can always use the refresh token to get a new token. If you display token and refresh token to your screen you should see an EXPIRE field. The Token probably has 3600 (1 hour) as it's expiry. What does Refresh Token show? |
Thank you for filing this issue. We asked some clarifying questions or suggested a course of action a week or more ago and never heard back from you. We are unable to proceed with this issue until then, so we are closing it. Please feel free to comment with more information and we will re-open this issue. |
So what's the final answer. I can see it's that refresh token does not expire. Am I correct?? |
You must write your code to anticipate the possibility that a granted refresh token might no longer work. A refresh token might stop working for one of these reasons: The user has revoked your app's access. https://developers.google.com/identity/protocols/OAuth2 You can try to getAccessToken which will use refresh token for that purpose. If the call fails, that means refresh token is not valid. |
OP is wondering why there isn't an explicit check if a refresh_token has expired (disconnected). |
So if refresh_token is expired or somehow not working what to do? Ask the user to re-connect. |
Hi i am getting offline access token using google api oauth 2.0 as i getting offline access so i will be using refresh token later to so basically i have seen that user can revoke our application access from his apps from his account and after that our refresh access token will not work.
So is their a way we can check if our refresh token is valid or not because for shot access tokens which are valid for only 1 h we can not do this
$client->isAccessTokenExpired()
is their a way we can also check if our refresh token is expired or not so that we can safely use it.
Here is my google client code
or does google api provide some kind of web hook when our user revoke our app access.
P.S i have tried to explore the google docs but could not find anything
Thanks in advance
The text was updated successfully, but these errors were encountered: