Google¶
Configure App and OAuth URLs¶
Use the following to configure a Google Cloud app for OAuth2. This includes configuring the OAuth 2.0 Redirect URL.
- Go to https://console.cloud.google.com/
- Select your project.
- Click "APIs and Services" > "Credentials"
Running the Examples¶
Two runnable examples load credentials from a credentials set file and fetch the signed-in user's Google profile.
OAuth 2.0 web flow (google/cmd/oauth2web), using an oauth2 credential
with "service": "google":
Service account (google/cmd/serviceaccount), using a gcpsa credential:
Both print only token metadata and the profile, never credentials or tokens.
Keep credentials files out of version control; this repository ignores files
starting with _, so a name like _credentials.json is not committed.
For "Sign in with Google" in your own application, see Sign in with Google or GitHub.