Losing access to Google Drive - "refresh token must be passed in or set as part of setAccessToken"

gravelldgravelld Administrator

I've had a few emails from Astiga and Google Drive users in the past week or two pointing to continued lost connections to Google Drive, with the following error message:

refresh token must be passed in or set as part of setAccessToken

Revoke access in Google Drive for Astiga, then edit the storage in Astiga, re-request the token and save it.

Longer explanation

When you grant access to Google Drive to Astiga, we receive a "token" which we use to prove we've been given access. This token has a lifespan of one hour. When you first request the token we also get a "refresh token" which we can use to re-request the token and keep things working.

However, if you ever re-request a token, the new token does not have the refresh token inside it. Currently, the edit storage page requires a token to be entered, but it's unpopulated, which means you might want to click the _Get code_ button to get a new token. If you do this, and copy/paste the token back into Astiga's "edit storage" page, and save it (as I advised you to do) this means the refresh token is lost, and access runs out after the default one hour.


You must revoke permissions in Google Drive for Astiga and re-request the token.

  1. Go to https://myaccount.google.com/u/0/permissions.
  2. Click Astiga.
  3. Click "REMOVE ACCESS" and confirm.

Now you can re-request the token. This new token should have the refresh_token:

  1. Go to https://play.asti.ga/settings
  2. Click the Google Drive storage account affected.
  3. Click "Get token".
  4. Authorise in Google Drive, then copy the resulting token back into the settings page.
  5. Click "Save storage".
Longer term

The issue here is that the edit storage page requires the token, which encourages you to click _Get code_ but this new code does not have the refresh token so access gets cut off after a following hour.

We will fix the edit storage page so the existing token is pre-populated.


Sign In or Register to comment.