1
votes

Is there a Go implementation of GCP Webflow similar to what gcloud SDK does (https://github.com/twistedpair/google-cloud-sdk/blob/master/google-cloud-sdk/lib/googlecloudsdk/core/credentials/flow.py)?

1
The docs have no mention of ConfigFromJSON to implement webflow for oauth2. I could not find any implementation in all of oauth2. - abergmeier
Redirect to the URL returned by Config.AuthCodeURL. In your redirect handler validate the state and call Config.Exchange, then use the client. - Peter
@Peter Can you please post your comment as an answer to help out the community? - Oliver Aragon

1 Answers

0
votes

this repo relies on printing a url in console and letting user to copy/paste Auth Code instead of automatically launching browser and running a local server like gcloud SDK does, but it's README is worth a read as it also shows you current limitations when using Oauth/openid connect flow to authenticate to Cloud Run.

If python is okay for you, there's an official python lib that supports launching browser and running a local server, like what gcloud sdk does.