AWS Cognito SSO
Configure AWS Cognito single sign-on for Cased CD Enterprise
This guide walks through setting up AWS Cognito as your identity provider for Cased CD Enterprise.
Prerequisites
Section titled “Prerequisites”- AWS account with Cognito access
- Cased CD Enterprise deployed
- ArgoCD 2.0+
-
Create a Cognito User Pool
Terminal window aws cognito-idp create-user-pool \--pool-name "cased-cd-sso" \--region us-west-2 \--auto-verified-attributes email \--policies "PasswordPolicy={MinimumLength=8,RequireUppercase=true,RequireLowercase=true,RequireNumbers=true,RequireSymbols=false}"Note the User Pool ID from the output (e.g.,
us-west-2_XXXXXXXXX). -
Create a Cognito domain
Terminal window aws cognito-idp create-user-pool-domain \--domain "your-company-cased-cd" \--user-pool-id us-west-2_XXXXXXXXX \--region us-west-2Your domain will be:
your-company-cased-cd.auth.us-west-2.amazoncognito.com -
Create an App Client (public, no secret)
Terminal window aws cognito-idp create-user-pool-client \--user-pool-id us-west-2_XXXXXXXXX \--client-name "cased-cd" \--region us-west-2 \--no-generate-secret \--callback-urls "https://cased-cd.example.com/auth/callback" \--logout-urls "https://cased-cd.example.com/login" \--allowed-o-auth-flows "code" \--allowed-o-auth-scopes "openid" "profile" "email" \--allowed-o-auth-flows-user-pool-client \--supported-identity-providers "COGNITO"Note the Client ID from the output.
For local development, also add
http://localhost:5173/auth/callbackto callback URLs. -
Configure ArgoCD
Terminal window kubectl patch configmap argocd-cm -n argocd --type merge -p 'data:url: "https://cased-cd.example.com"oidc.config: |name: AWS Cognitoissuer: https://cognito-idp.us-west-2.amazonaws.com/us-west-2_XXXXXXXXXclientID: YOUR_CLIENT_IDrequestedScopes: ["openid", "profile", "email"]' -
Configure Cased CD with Cognito domain
Terminal window helm upgrade cased-cd cased/cased-cd-enterprise \--namespace argocd \--set 'imagePullSecrets[0].name=cased-cd-registry' \--set cognito.domain=your-company-cased-cd.auth.us-west-2.amazoncognito.comOr set the environment variable directly:
Terminal window kubectl set env deployment/cased-cd-enterprise \-n argocd \COGNITO_DOMAIN=your-company-cased-cd.auth.us-west-2.amazoncognito.com -
Restart ArgoCD
Terminal window kubectl rollout restart deployment argocd-server -n argocd
Test the login
Section titled “Test the login”- Navigate to your Cased CD login page
- Click “Sign in with AWS Cognito”
- Log in with your Cognito user credentials
- You’ll be redirected back and logged in
Create test users
Section titled “Create test users”# Create a useraws cognito-idp admin-create-user \ --user-pool-id us-west-2_XXXXXXXXX \ --username user@example.com \ --user-attributes Name=email,Value=user@example.com Name=email_verified,Value=true \ --region us-west-2
# Set a permanent passwordaws cognito-idp admin-set-user-password \ --user-pool-id us-west-2_XXXXXXXXX \ --username user@example.com \ --password "SecurePassword123!" \ --permanent \ --region us-west-2Configure groups
Section titled “Configure groups”Create groups in Cognito and map them to ArgoCD RBAC roles:
# Create a group in Cognitoaws cognito-idp create-group \ --user-pool-id us-west-2_XXXXXXXXX \ --group-name developers \ --region us-west-2
# Add a user to the groupaws cognito-idp admin-add-user-to-group \ --user-pool-id us-west-2_XXXXXXXXX \ --username user@example.com \ --group-name developers \ --region us-west-2Then configure ArgoCD RBAC:
kubectl patch configmap argocd-rbac-cm -n argocd --type merge -p 'data: policy.csv: | p, role:developer, applications, get, */*, allow p, role:developer, applications, sync, */*, allow g, developers, role:developer'Troubleshooting
Section titled “Troubleshooting””No access token received” error
Section titled “”No access token received” error”This usually means the Cognito domain is not configured. Verify:
COGNITO_DOMAINenvironment variable is set on the enterprise deployment- The domain matches your Cognito User Pool domain exactly
”unauthorized_client” error
Section titled “”unauthorized_client” error”Check that:
- The App Client has “Authorization code grant” enabled
- The callback URL is registered correctly
- The App Client is a public client (no secret)
Groups not working
Section titled “Groups not working”- Verify users are added to Cognito groups (not just attributes)
- Group names in Cognito must match ArgoCD RBAC policy exactly
- Cognito automatically includes groups in the
cognito:groupsclaim