1

We are using calendar API of google and it's working fine and we have achieved almost each requirement.

But we stuck at below point, How to generate new "Refresh Token" once it's revoked or expired?

Also I need more information on when "Refresh Token" expire and how would I know the life of this refresh token, so I can automatically create new before it expired?

Any answers is highly appreciated.

Rakesh P.
  • 58
  • 7

1 Answers1

1

You may want to check this related SO post, refresh token doesn't expires unless the user revokes it. Until it does, your app must catch this issue then ask the user for permission in order to avoid encountering such problem. Here is the link for the documentation of Google:

Save refresh tokens in secure long-term storage and continue to use them as long as they remain valid. Limits apply to the number of refresh tokens that are issued per client-user combination, and per user across all clients, and these limits are different. If your application requests enough refresh tokens to go over one of the limits, older refresh tokens stop working.

If you'll continue reading until Token expiration:

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.
  • The refresh token has not been used for six months.
  • The user changed passwords and the refresh token contains Gmail scopes.
  • The user account has exceeded a maximum number of granted (live) refresh tokens.

Hope this clarifies your concern.

Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91