Skip to main content
Single Sign-On (SSO) allows users to authenticate with Cal.com using their organization’s identity provider instead of creating separate credentials. Cal.com supports both SAML and OIDC protocols.

Overview

SSO provides:
  • Centralized Authentication: Users log in through your identity provider
  • Enhanced Security: Leverage your organization’s security policies
  • Simplified Management: Centrally manage user access and permissions
  • Automatic Provisioning: Works with SCIM for user lifecycle management

Prerequisites

  • Cal.com Enterprise license
  • Organizations feature enabled
  • Separate PostgreSQL database for SAML/SSO data
  • Identity Provider (IdP) supporting SAML 2.0 or OIDC

Configuration

1. Environment Variables

Add the following to your .env file:
.env
Source: .env.example:46-55

2. Database Setup

Create a separate PostgreSQL database for SSO data:

3. Jackson SSO Library

Cal.com uses BoxyHQ’s Jackson library for SSO implementation. Jackson Configuration:
Source: packages/features/ee/sso/lib/jackson.ts:19-33

SSO Admin Access

Self-Hosted

For self-hosted deployments, SSO configuration is restricted to admins listed in SAML_ADMINS:
Source: packages/features/ee/sso/lib/saml.ts:20-30

Hosted Cal.com

For hosted deployments, SSO access is controlled by organization permissions:
  • Organization Owners: Full SSO configuration access
  • Organization Admins: Full SSO configuration access
  • Organization Members: No SSO configuration access
Source: packages/features/ee/sso/lib/saml.ts:32-81

SSO Login Flow

1. User Initiates Login

User enters email at login screen:

2. Identity Provider Authentication

3. Cal.com Processes Response

Source: packages/features/ee/sso/lib/sso.ts:26-83

Automatic User Provisioning

SSO can automatically provision users on first login:

Email Domain Matching

When ORGANIZATIONS_AUTOLINK=1 is enabled:
Source: packages/features/ee/sso/lib/sso.ts:34-49

Organization Assignment

Users are automatically assigned to organizations based on:
  1. Email Domain: Matching verified organization domain
  2. Existing Membership: Current team memberships
  3. SSO Connection: Configured SSO tenant mapping
Source: packages/features/ee/sso/lib/sso.ts:26-83

Multi-Team SSO

Cal.com supports SSO across multiple teams within an organization:
Source: packages/features/ee/sso/lib/sso.ts:56-70

SSO Tenants

Each team/organization has its own SSO tenant:
  • Tenant ID Format: team-{teamId}
  • Product ID: Cal.com
  • Audience: https://saml.cal.com
Source: packages/features/ee/sso/lib/saml.ts:10-18

Security Considerations

Client Secret Verification

For enhanced security during OAuth 2.0 flows:
.env
Use this value as client_secret during the OAuth 2.0 flow. Source: .env.example:55

Encryption

All SSO credentials and sensitive data are encrypted using the CALENDSO_ENCRYPTION_KEY:
Source: packages/features/ee/sso/lib/jackson.ts:29

Admin Restrictions

SSO configuration is restricted to:
  • Emails listed in SAML_ADMINS (self-hosted)
  • Organization Owners/Admins (hosted)
Source: packages/features/ee/sso/lib/saml.ts:32-81

Troubleshooting

SSO Not Available

Error: “To enable this feature, add value for SAML_DATABASE_URL and SAML_ADMINS to your .env Solution: Ensure environment variables are configured:
Source: packages/features/ee/sso/lib/saml.ts:35-39

Permission Denied

Error: “dont_have_permission” Solutions:
  • Self-hosted: Add your email to SAML_ADMINS
  • Hosted: Verify you have Owner or Admin role in the organization
Source: packages/features/ee/sso/lib/saml.ts:46-74

No SSO Connection Found

Error: “Could not find a SSO Identity Provider for your email. Please contact your admin to ensure you have been given access to Cal” Solutions:
  1. Verify SSO connection is configured for your team/organization
  2. Check that your email matches an existing membership
  3. Confirm the SSO tenant is correctly mapped
  4. Review SSO connection status in organization settings
Source: packages/features/ee/sso/lib/sso.ts:72-77

User Belongs to Different Organization

Error: “User belongs to another organization.” Solution: Users can only belong to one organization. Contact support to migrate the user. Source: packages/features/ee/dsync/lib/handleUserEvents.ts:81-83

API Endpoints

SSO uses the following API endpoints: Source: packages/features/ee/sso/lib/jackson.ts:21-24

Best Practices

  1. Use Separate Database: Always use a dedicated database for SSO data to isolate sensitive authentication information
  2. Rotate Secrets: Regularly rotate SAML_CLIENT_SECRET_VERIFIER and CALENDSO_ENCRYPTION_KEY
  3. Limit Admins: Only add necessary users to SAML_ADMINS
  4. Test Thoroughly: Test SSO flow in staging before production deployment
  5. Monitor Logs: Enable logging for SSO events to track authentication issues
  6. Use SCIM: Combine SSO with SCIM for automated user lifecycle management