v2026.1 Open Portal ↗
On this page

Cognito User Pool

User Pool Configuration

The StackFlow Cognito User Pool (us-east-1_WKK1AVJ2m) is the authoritative identity store for all native StackFlow users. It is configured in the us-east-1 region under AWS account 373544523367. The pool uses email as the primary sign-in attribute and enforces case-insensitive email matching.

⚙️ Minimum Requirements
  • User Pool: us-east-1_WKK1AVJ2m active in us-east-1 under account 373544523367
  • Pre-Token Lambda: StackFlowCognitoPreToken trigger attached and deployed
  • Post-Confirmation Lambda: StackFlowCognitoPostConfirm trigger attached with dynamodb:PutItem on StackFlow_User
  • IAM Role: Cognito service role must have lambda:InvokeFunction on all three trigger Lambdas
  • SES: no-reply@stackflow-tech.com verified in us-east-1 for welcome emails
SettingValue
Pool IDus-east-1_WKK1AVJ2m
App Client ID570cnagpgoochn29a113du6jnt
Hosted UI Domainstackflow-identity-373544523367.auth.us-east-1.amazoncognito.com
Sign-in MethodEmail (case-insensitive)
MFAOptional (TOTP and SMS)
Password Policy12+ chars, upper, lower, digit, symbol
Token ValidityAccess: 1h | ID: 1h | Refresh: 30d

App Client Settings

The 570cnagpgoochn29a113du6jnt app client is configured for the Authorization Code flow with PKCE, which is the recommended OAuth 2.0 flow for SPAs and web applications. The implicit flow is explicitly disabled. Allowed callback URLs must be registered in the app client configuration before they can be used in authentication requests.

# View app client configuration
aws cognito-idp describe-user-pool-client   --user-pool-id us-east-1_WKK1AVJ2m   --client-id 570cnagpgoochn29a113du6jnt   --region us-east-1

# Add a new callback URL (e.g., for a dev environment)
aws cognito-idp update-user-pool-client   --user-pool-id us-east-1_WKK1AVJ2m   --client-id 570cnagpgoochn29a113du6jnt   --callback-urls '["https://your-instance.stackflow-tech.com/callback","https://localhost:3000/callback"]'   --region us-east-1

User Attributes

StackFlow uses standard Cognito attributes plus custom attributes for role assignment and tenant isolation. Custom attributes are prefixed with custom: and are read-only from the user's perspective (only administrators can modify them).

AttributeTypeDescription
emailStandardPrimary identifier, must be verified
given_nameStandardFirst name
family_nameStandardLast name
custom:tenant_idCustom (string)Tenant identifier for multi-tenancy isolation
custom:roleCustom (string)Comma-separated StackFlow role names
custom:departmentCustom (string)Department ID from StackFlow org structure

Triggers & Lambdas

Three Cognito Lambda triggers are configured to customize the authentication flow. The Pre-Signup trigger validates new user emails against an approved domain allowlist. The Post-Confirmation trigger creates the user's StackFlow profile record in Aurora PostgreSQL. The Pre-Token-Generation trigger enriches the JWT with role claims from the StackFlow database.

Trigger Timeouts: Cognito triggers have a hard 5-second timeout. If the StackFlowAPI Lambda experiences a cold start during the Post-Confirmation trigger, user account creation may fail. The Lambda is kept warm via the StackFlowCacheWarmer scheduled function (every 4 minutes).

User Management via CLI

Administrators can manage users directly via the AWS CLI when the portal UI is unavailable. Common operations include resetting passwords, enabling/disabling accounts, and updating custom attributes.

# Create a new user
aws cognito-idp admin-create-user   --user-pool-id us-east-1_WKK1AVJ2m   --username user@example.com   --user-attributes Name=email,Value=user@example.com Name=email_verified,Value=true                     Name=custom:role,Value=itsm_agent Name=custom:tenant_id,Value=tenant_001   --temporary-password "TempPass123!"   --region us-east-1

# Reset a user's password
aws cognito-idp admin-set-user-password   --user-pool-id us-east-1_WKK1AVJ2m   --username user@example.com   --password "NewSecurePass456!"   --permanent   --region us-east-1

# Disable a user account
aws cognito-idp admin-disable-user   --user-pool-id us-east-1_WKK1AVJ2m   --username user@example.com   --region us-east-1