@@ -12,7 +12,7 @@ You need:
1212
1313- permission to manage a Google Cloud project associated with the
1414 ` datatalks.club ` Google Workspace organization;
15- - permission to update Actions secrets in ` DataTalksClub/aws-infra ` ;
15+ - permission to update ` dtcdev-shared-auth/google-oauth ` in AWS Secrets Manager ;
1616- permission to run that repository's shared-auth deployment workflow;
1717- access to one ` @datatalks.club ` Google account for the allowed test and one
1818 non-domain Google account for the rejection test.
@@ -61,23 +61,22 @@ The client ID is not confidential; the client secret is.
6161
6262## 3. Store the credentials for deployment
6363
64- Store both values as encrypted GitHub Actions secrets in
65- ` DataTalksClub/aws-infra ` :
64+ Open AWS Secrets Manager in ` us-east-1 ` and create a secret named:
6665
67- - ` SHARED_AUTH_GOOGLE_CLIENT_ID `
68- - ` SHARED_AUTH_GOOGLE_CLIENT_SECRET `
66+ ``` text
67+ dtcdev-shared-auth/google-oauth
68+ ```
6969
70- Use ** Repository settings → Secrets and variables → Actions → New repository
71- secret** , or run these commands in an interactive terminal from a trusted
72- machine:
70+ Choose ** Other type of secret** and store two key/value pairs:
7371
74- ``` bash
75- gh secret set SHARED_AUTH_GOOGLE_CLIENT_ID --repo DataTalksClub/aws-infra
76- gh secret set SHARED_AUTH_GOOGLE_CLIENT_SECRET --repo DataTalksClub/aws-infra
77- ```
72+ | Key | Value |
73+ | --- | --- |
74+ | ` client_id ` | The Google OAuth client ID |
75+ | ` client_secret ` | The matching Google OAuth client secret |
7876
79- Each command reads the value without putting it in source control. Do not add
80- the values to ` .env ` , CloudFormation parameter files, or this repository.
77+ GitHub stores neither value. The GitHub deployment role can inspect only the
78+ secret's version metadata; the CloudFormation service role resolves the actual
79+ values within AWS and supplies them directly to Cognito.
8180
8281## 4. Deploy the Cognito provider
8382
@@ -88,8 +87,9 @@ gh workflow run deploy-shared-auth.yml --repo DataTalksClub/aws-infra
8887```
8988
9089The workflow uses GitHub OIDC to assume the least-privilege AWS deployment
91- role, passes the two secrets as ` NoEcho ` CloudFormation parameters , updates the
90+ role, reads the current non-secret version ID , updates the
9291` dtcdev-shared-auth ` stack in ` us-east-1 ` , and verifies the Google provider.
92+ Only CloudFormation's AWS service role can read the credential value.
9393
9494After it succeeds, this repository's ** CI and deploy auth policy** workflow
9595deploys and verifies the domain-guard Lambda independently. It does not need or
@@ -138,15 +138,14 @@ to recover or reuse a value that may have been exposed.
138138Use this order to avoid unnecessary downtime:
139139
1401401 . Create the replacement Google OAuth client.
141- 2 . Update both ` SHARED_AUTH_GOOGLE_CLIENT_* ` GitHub secrets.
142- 3 . run the ` aws-infra ` shared-auth deployment workflow;
143- 4 . complete an allowed Google sign-in;
141+ 2 . Create a new version of ` dtcdev-shared-auth/google-oauth ` in AWS Secrets
142+ Manager with the replacement ` client_id ` and ` client_secret ` values.
143+ 3 . Run the ` aws-infra ` shared-auth deployment workflow; it passes the new
144+ version ID so Cognito refreshes both values.
145+ 4 . Complete an allowed Google sign-in.
1441465 . delete the old OAuth client in Google Cloud;
1451476 . rerun the automated verifier and the non-domain rejection test.
146148
147- The currently deployed Google client secret must be rotated because it appeared
148- in an AWS diagnostic response during setup verification.
149-
150149## Troubleshooting
151150
152151- ` redirect_uri_mismatch ` : compare the Google client redirect character for
0 commit comments