grow / grow

A declarative website generator designed for high-quality websites, with a focus on easy maintenance and localization.
https://grow.dev
MIT License
402 stars 50 forks source link

Grow uses OOB to authenticate, which is outdated #1215

Open tpeng3 opened 1 year ago

tpeng3 commented 1 year ago

Hello, I noticed grow's oauth.py but that's no longer supported by Google as of 2022. It needs to be migrated otherwise there'll be an issue deploying staging links to places like webreview.

https://developers.google.com/identity/protocols/oauth2/resources/oob-migration

jeremydw commented 1 year ago

Hi there,

This came up earlier on the growsdk mailing list. Here are the instructions I sent over:

When running either the staging or preprocess commands, please supply the --interactive-auth flag to indicate that Grow should receive the Oauth authorization code via a local web server: https://developers.google.com/identity/protocols/oauth2/native-app#handlingresponse

Here's a sample command:

grow --auth=[user@domain.com](mailto:user@domain.com) --interactive-auth stage

Note that you'll only need to supply these flags once (when you first authenticate). After that, you can run:

grow stage

Additionally, if you want to reset the local storage of all credentials, you can use:

grow --clear-auth --interactive-auth stage

And that will allow you to start from scratch.

The key requirement here is to supply --interactive-auth which triggers the redirect-based flow (rather than the copy-paste-based flow). As an alternative, you can also authenticate with a service account key file using:

grow --auth-key-file=path/to/key/file.json stage

I'll look into removing the OOB/copy-paste flow from Grow to make this more obvious now that that flow has been deprecated by Google.

We can leave this issue open as the tracking issue for removing the flow.

tpeng3 commented 1 year ago

Thank you, the command fixed the issue for me!