Skip to main content

MFA Setup

Configure multi-factor authentication (MFA) using AWS Cognito TOTP for enhanced security across your organization.

Overview

MFA adds an additional layer of security by requiring users to provide a time-based one-time password (TOTP) in addition to their password.

Source: AWS Cognito User Pool configuration

Compliance: SOC 2 CC6.1, NIST IA-2, PCI-DSS 8.3.1, HIPAA 164.312(d)

MFA Configuration Levels

Organization-Level MFA

SettingDescription
OFFMFA disabled
OPTIONALUser can enable MFA
ONMFA required for all users

Current Configuration

Check your organization's MFA setting:

curl https://pilot.owkai.app/api/organizations/settings \
-H "Cookie: session=YOUR_SESSION_COOKIE"

Response:

{
"mfa": {
"configuration": "OPTIONAL",
"enforced": false
}
}

User MFA Enrollment

Enrollment Flow

  1. User logs in with username/password
  2. System detects MFA not configured
  3. User presented with TOTP setup screen
  4. User scans QR code with authenticator app
  5. User enters verification code
  6. MFA successfully configured

Supported Authenticator Apps

AppPlatformRecommended
Google AuthenticatoriOS, AndroidYes
Microsoft AuthenticatoriOS, AndroidYes
AuthyiOS, Android, DesktopYes
1PasswordAll platformsYes

Admin MFA Management

Requiring MFA for Admin Users

For admin users, MFA should be enforced:

{
"role": "admin",
"is_org_admin": true,
"mfa_required": true
}

Per-User MFA Status

View user MFA status in user list:

{
"id": 15,
"email": "admin@company.com",
"mfa_enabled": true,
"compliance_status": "Compliant"
}

MFA Triggers

Risk-Based MFA Requirement

MFA can be triggered based on agent risk scores:

SettingDefaultDescription
requires_mfa_above70Trigger MFA for high-risk actions

Actions with risk score above threshold require MFA confirmation.

Cognito MFA Configuration

Pool-Level Settings

SettingValueDescription
MFA TypeTOTPTime-based one-time password
RecoveryEnabledRecovery codes available
Remember Device30 daysSkip MFA on trusted devices

App Client Settings

SettingDescription
ExplicitAuthFlowsUSER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH
PreventUserExistenceErrorsENABLED (security)

Password Policy

MFA works alongside strong password requirements:

RequirementSetting
Minimum Length12 characters
UppercaseRequired
LowercaseRequired
NumbersRequired
Special CharactersRequired
Password Age90 days maximum

Session Settings

Session Security with MFA

SettingValueDescription
timeout_minutes60Session timeout
max_concurrent_sessions5Max active sessions

Token Configuration

Token TypeValidity
Access Token60 minutes
ID Token60 minutes
Refresh Token30 days

Enterprise MFA Features

High-Risk Action Re-Authentication

For actions exceeding requires_mfa_above:

  1. User attempts high-risk action
  2. System prompts for MFA code
  3. User enters TOTP code
  4. Action proceeds if verified

Admin Override Logging

All MFA bypasses are logged:

EventDetails
mfa_bypassAdmin user, reason, timestamp
mfa_resetTarget user, admin, timestamp

API Reference

EndpointMethodDescription
/api/organizations/settingsGETGet MFA config
/api/auth/mfa/setupPOSTInitiate MFA setup
/api/auth/mfa/verifyPOSTVerify MFA code
/api/auth/mfa/disablePOSTDisable user MFA (admin)

Known Issues

SEC-035: MFA Setup Missing QR Code

Status: Pending

Issue: MFA setup screen may not display QR code.

Workaround: Use manual setup key if QR code unavailable.

SEC-037: MFA Cannot Be Disabled

Status: Under investigation

Issue: MFA prompt may appear even after disabling.

Workaround: Contact support for pool-level configuration.

Best Practices

  1. Enforce for admins: Require MFA for all admin users
  2. Gradual rollout: Start with OPTIONAL, move to ON
  3. Backup codes: Ensure users save recovery codes
  4. Recovery process: Document MFA recovery procedure
  5. Regular audits: Review MFA adoption rates
  6. Monitor failures: Alert on repeated MFA failures

Troubleshooting

User cannot complete MFA setup

Check:

  • Authenticator app time sync (should match server time)
  • QR code scanning (try manual key entry)
  • Network connectivity

MFA code rejected

Causes:

  • Clock drift on user device
  • Code expired (30-second window)
  • Wrong account selected in authenticator

Solution: Ensure device time is synced; codes valid for 30 seconds.

Lost authenticator access

Process:

  1. User contacts admin
  2. Admin verifies identity
  3. Admin resets MFA via Cognito console
  4. User re-enrolls

MFA prompt on every login

Cause: "Remember Device" not working.

Solution: Check browser cookies; ensure device is trusted.


Source: AWS Cognito User Pool configuration, organization_admin_routes.py