This guide explains how to configure Single Sign-On (SSO) integration with the Edge CV Portal using SAML 2.0 or OIDC.
The Portal supports flexible authentication options:
- Cognito User Pool only (default) - Users authenticate directly with Cognito
- Cognito + SAML Federation - Users authenticate via company SSO (Okta, Azure AD, etc.)
- Cognito + OIDC Federation - Users authenticate via OIDC-compliant identity providers
Configure these environment variables before deploying the auth stack:
# SSO Configuration
export SSO_ENABLED=true # Enable SSO integration
export SSO_METADATA_URL=https://your-idp.com/metadata.xml # SAML metadata URL
export SSO_PROVIDER_NAME=YourCompanySSO # Display name for SSO provider
export COGNITO_DOMAIN_PREFIX=your-company-dda-portal # Unique domain prefix
# Optional: Frontend URLs (will be configured automatically if not set)
export FRONTEND_URL=https://your-domain.com # Production frontend URLexport SSO_ENABLED=true
export SSO_METADATA_URL=https://your-org.okta.com/app/abc123/sso/saml/metadata
export SSO_PROVIDER_NAME=Oktaexport SSO_ENABLED=true
export SSO_METADATA_URL=https://login.microsoftonline.com/your-tenant-id/federationmetadata/2007-06/federationmetadata.xml
export SSO_PROVIDER_NAME=AzureADexport SSO_ENABLED=true
export SSO_METADATA_URL=https://accounts.google.com/o/saml2/idp?idpid=your-idp-id
export SSO_PROVIDER_NAME=GoogleWorkspaceThe Portal expects these SAML attributes from your identity provider:
| Portal Attribute | SAML Claim | Description |
|---|---|---|
| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress | User email address | |
| given_name | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname | First name |
| family_name | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname | Last name |
| groups | http://schemas.xmlsoap.org/claims/Group | Group memberships |
| role | http://schemas.microsoft.com/ws/2008/06/identity/claims/role | User role |
Configure your identity provider to send group/role information that maps to Portal roles:
| IdP Group/Role | Portal Role | Permissions |
|---|---|---|
| portal-admins | PortalAdmin | Full access to all use cases |
| cv-data-scientists | DataScientist | Labeling, training, model registry |
| cv-operators | Operator | Deployments, device management |
| cv-viewers | Viewer | Read-only access |
-
Configure Environment Variables
export SSO_ENABLED=true export SSO_METADATA_URL=https://your-idp.com/metadata.xml export SSO_PROVIDER_NAME=YourCompanySSO export COGNITO_DOMAIN_PREFIX=your-company-dda-portal
-
Deploy Auth Stack
cd infrastructure npm run build cdk deploy EdgeCVPortalAuthStackDeploying the whole portal with
deploy-portal.sh? Export theSSO_*variables above and pass--ssoinstead (fromedge-cv-portal/:./deploy-portal.sh single-account --sso). It forwards--ssoand theSSO_METADATA_URL,SSO_PROVIDER_NAMEandCOGNITO_DOMAIN_PREFIXvariables toinfrastructure/deploy-auth.sh, which deploys this stack. -
Configure Identity Provider
- Add the Cognito SAML endpoint as a service provider in your IdP
- Configure attribute mappings as shown above
- Set up group/role assignments for users
-
Update Frontend Configuration
- The auth stack outputs will include the necessary configuration
- Update your frontend deployment with the new auth settings
-
Verify Deployment
# Check that the identity provider was created aws cognito-idp list-identity-providers --user-pool-id <your-pool-id>
-
Test Login Flow
- Navigate to the Cognito hosted UI
- Click on your SSO provider
- Complete authentication with your company credentials
- Verify that user attributes are mapped correctly
-
Verify Role Mapping
- Check that group memberships are correctly mapped to Portal roles
- Test access controls with different user roles
-
SAML Metadata URL not accessible
- Ensure the metadata URL is publicly accessible
- Check firewall rules and network connectivity
-
Attribute mapping issues
- Verify that your IdP sends the expected SAML attributes
- Check attribute names match the configuration
-
Domain prefix conflicts
- Cognito domain prefixes must be globally unique
- Try a different prefix if deployment fails
-
Role mapping not working
- Verify group/role claims are included in SAML assertion
- Check that attribute mapping configuration is correct
# Check Cognito configuration
aws cognito-idp describe-user-pool --user-pool-id <pool-id>
# List identity providers
aws cognito-idp list-identity-providers --user-pool-id <pool-id>
# Check user attributes after login
aws cognito-idp admin-get-user --user-pool-id <pool-id> --username <username>-
SAML Signing
- Ensure SAML assertions are signed by your IdP
- Verify certificate validity and rotation procedures
-
Attribute Validation
- Validate that group/role attributes cannot be spoofed
- Implement proper access controls in your IdP
-
Session Management
- Configure appropriate session timeouts
- Implement proper logout procedures
-
Audit Logging
- Monitor authentication events in CloudTrail
- Set up alerts for failed authentication attempts
After SSO is configured:
- Deploy the remaining infrastructure stacks
- Configure use case assignments for users
- Set up role-based access controls
- Test the complete authentication flow