Google Upstream Auth
This guide shows you how to create a Google OAuth application for use with Easy OIDC.
Prerequisites
- A Google account (Google Workspace or personal Gmail)
- Admin access to create OAuth applications
Step 1: Create a Google Cloud Project
- Go to the Google Cloud Console
- Click Select a project → New Project
- Enter a project name (e.g.,
easy-oidc) - Click Create
Step 2: Configure OAuth Consent Screen
- In the Google Cloud Console, navigate to APIs & Services → OAuth consent screen
- Select Internal if you have a Google Workspace account (recommended), or External for personal Gmail
- Click Create
- Fill in the required fields:
- App name:
Easy OIDC - User support email: Your email address
- Developer contact information: Your email address
- App name:
- Click Save and Continue
- On the Scopes page, click Add or Remove Scopes
- Select the following scopes:
openidemailprofile
- Click Update → Save and Continue
- Review and click Back to Dashboard
Step 3: Create OAuth Credentials
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Select Application type: Web application
- Enter a Name:
Easy OIDC - Under Authorized redirect URIs, click Add URI
- Add your redirect URI:
https://auth.example.com/callback/google- Replace
auth.example.comwith your actual OIDC hostname
- Replace
- Click Create
Step 4: Save Client ID and Secret
After creating the OAuth client, Google will display your credentials:
- Client ID:
123456789-abcdefghijklmnop.apps.googleusercontent.com - Client Secret:
GOCSPX-xxxxxxxxxxxxxxxxxxxx
Important: Copy these values now—you’ll need them in the next step.
Step 5: Store Credentials in AWS Secrets Manager
Use the AWS CLI to store your Google OAuth credentials:
aws secretsmanager create-secret \
--name easy-oidc-connector-secret \
--secret-string '{
"client_id": "123456789-abcdefghijklmnop.apps.googleusercontent.com",
"client_secret": "GOCSPX-xxxxxxxxxxxxxxxxxxxx"
}'Replace the client_id and client_secret values with your actual credentials from Step 4.
Optional: Restrict to Google Workspace Domain
If you’re using Google Workspace and want to restrict authentication to your organization’s domain:
- When configuring Easy OIDC via Terraform, add the
connector_hosted_domainvariable:
module "easy_oidc" {
source = "easy-oidc/easy-oidc/aws"
# ... other config ...
connector_type = "google"
connector_hosted_domain = "example.com" # Your Google Workspace domain
}This ensures only users with @example.com email addresses can authenticate.
Verification
To verify your OAuth app is configured correctly:
- Note your redirect URI:
https://auth.example.com/callback/google - After deploying Easy OIDC (see Deploy to AWS), test authentication:
kubectl oidc-login setup \
--oidc-issuer-url=https://auth.example.com \
--oidc-client-id=kubelogin-prod \
--oidc-use-pkceYou should be redirected to Google’s login page.