How to rotate Google oAuth client secret without downtime?

Viewed 1112

I need to rotate the Google oAuth secret. For that I just need to go to the Google Cloud Platform Console > "APIs and Services" > "Credentials" > click on the client id under "OAuth 2.0 client IDs" > press the Reset Secret button.

Then I need to take the newly generated secret and configure my servers to use it instead of the old one. Until I do this, my service will be inaccessible.

How can I do this credential rotation and keep my service fully up through the operation?

1 Answers

I think the best way to rotate credentials without downtime is to create a new client. So the flow would be:

  • Create new credentials/client (identical to an old one)
  • Use credentials from the new client in your application
  • Remove the old credentials/client (credentials will not be valid anymore)
Related