steampipe-plugin-googleworkspace icon indicating copy to clipboard operation
steampipe-plugin-googleworkspace copied to clipboard

can we use the refresh token in ./config/gcloud/application_default_credentials.json?

Open judell opened this issue 3 years ago • 6 comments

I am using method 2 from https://hub.steampipe.io/plugins/turbot/googleworkspace. I acquire the credentials file like so:

gcloud auth application-default login --client-id-file=client_secret.json --scopes="https://www.googleapis.com/auth/calendar.readonly,https://www.googleapis.com/auth/contacts.other.readonly,https://www.googleapis.com/auth/contacts.readonly,https://www.googleapis.com/auth/directory.readonly,https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/spreadsheets.readonly"

After a couple of days this happens:

googleapi: Error 401: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.

I can, and do, reacquire the credentials file. But there's a refresh token in it, shouldn't the underlying Go SDK use that to refresh the access token?

per @cbruno10:

here’s a possibly relevant discussion from the SDK repo - https://github.com/googleapis/google-api-go-client/issues/111

If that works it will also benefit the Google Directory and Google Sheets plugins.

judell avatar Apr 01 '22 16:04 judell

@judell thanks for opening this issue. We are looking into this issue. Seems like the access token is not getting refreshed after getting expired. We have checked the SDK and seems like ReUseTokenSource is probable solution. We will provide an update on this ASAP.

Subhajit97 avatar Apr 21 '22 15:04 Subhajit97

'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

github-actions[bot] avatar Sep 29 '22 23:09 github-actions[bot]

'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

github-actions[bot] avatar Dec 02 '22 23:12 github-actions[bot]

'This issue was closed because it has been stalled for 90 days with no activity.'

github-actions[bot] avatar Jan 01 '23 23:01 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 28 '23 23:09 github-actions[bot]

This issue was closed because it has been stalled for 90 days with no activity.

github-actions[bot] avatar Oct 29 '23 23:10 github-actions[bot]

@judell after reviewing the issue, we've determined that it is not currently a priority in our roadmap. While we acknowledge its importance, we need to focus on higher-priority tasks at this time.

We’re closing this issue for now, but we encourage further discussion if there are critical concerns. If priorities shift in the future, we may revisit this.

Thanks again for your input!

misraved avatar Feb 10 '25 13:02 misraved