Configure Google identity provider in Cognito with OAuth credentials.
Updates the placeholder Google identity provider created by CDK with real OAuth credentials collected from GCP setup. This enables Google social login for user authentication.
Note: Microsoft authentication is handled directly by the application (not via Cognito) due to Cognito's strict issuer validation rejecting Microsoft's multi-tenant tokens. See outlook-setup.md for Microsoft OAuth configuration.
After:
/v1-orcha/cognito-google-client-*)Before:
/v1-orcha/cognito-google-client-id/v1-orcha/cognito-google-client-secret/v1-orcha/cognito-user-pool-id)cd /home/volrath/code/orcha/orcha/infra
# Default: reads credentials from SSM
./scripts/setup-cognito-idps.sh --profile orcha-prod
# Dry run (show what would be updated)
./scripts/setup-cognito-idps.sh --profile orcha-prod --dry-run
The script reads credentials from SSM and updates the Cognito Google identity provider.
/v1-orcha/cognito-google-client-id)/v1-orcha/cognito-google-client-secret)# Verify Google IdP is configured (should show real client ID, not placeholder)
aws cognito-idp describe-identity-provider \
--profile orcha-prod \
--region eu-central-1 \
--user-pool-id $(aws ssm get-parameter --profile orcha-prod --region eu-central-1 --name /v1-orcha/cognito-user-pool-id --query 'Parameter.Value' --output text) \
--provider-name Google \
--query 'IdentityProvider.ProviderDetails.client_id' \
--output text
Cause: CDK hasn't created the identity providers yet.
Fix: Ensure CDK has been deployed first. The Google identity provider is created with placeholder values during CDK deployment.
Cause: AWS credentials don't have permission to modify Cognito.
Fix: Ensure your AWS profile has cognito-idp:UpdateIdentityProvider permission.
The CDK deployment role should have this.
Cause: The redirect URI in Google Cloud Console doesn't match Cognito's callback URL.
Fix: Ensure the Google OAuth app has this exact redirect URI:
https://{cognito-domain}.auth.eu-central-1.amazoncognito.com/oauth2/idpresponse
Cause: The OAuth credentials haven't been stored in SSM yet.
Fix:
./scripts/update-secrets.sh --from-file secretsaws ssm get-parameter --profile orcha-prod --region eu-central-1 --name /v1-orcha/cognito-google-client-id
| Resource | Prod Value |
|---|---|
| User Pool Name | v1-orcha-user-pool |
| Cognito Domain | v1-orcha-prod-auth |
| Google IdP Name | Google |
| Google Redirect URI | https://v1-orcha-prod-auth.auth.eu-central-1.amazoncognito.com/oauth2/idpresponse |
| Script | scripts/setup-cognito-idps.sh |
Google Login: User → App → Cognito → Google → Cognito → App
Microsoft: User → App → Microsoft directly → App (bypasses Cognito)
Google uses Cognito's hosted UI flow. Microsoft authentication is handled directly by the application because Cognito's OIDC issuer validation rejects Microsoft's multi-tenant tokens (issuer varies by tenant ID).