1
votes

I am using Oauth to access Google Cloud Storage via their JSON API.

All is fine, I authenticate and get an access token which has an expiration of 3600.

What is the correct way to refresh this?

It is my understanding that in other types of oAuth flows (i.e. Web Server), the initial authorization request returns a refresh token as well as an access token, and that the refresh token is used to ask for another access token when the current access token has expired.

But is appears that there is no refresh token when doing server-to-server oAuth with a Google "Service Account"?

1

1 Answers

3
votes

Found the answer.

https://developers.google.com/accounts/docs/OAuth2ServiceAccount#expiration

Access tokens issued by the Google OAuth 2.0 Authorization Server expire one hour after they are issued. When an access token expires, then the application should generate another JWT, sign it, and request another access token.