Single Sign On
Single Sign-On (SSO) Setup Guide
What is Single Sign-On?
Single Sign-On (SSO) allows your team to access Contextium using your organization's existing identity provider (like Okta, Azure AD, or Google Workspace). Instead of managing separate passwords, users authenticate through your company's login system.
Benefits
- 🔐 Enhanced Security: Centralized authentication through your identity provider
- ⚡ Faster Onboarding: New team members get instant access through your directory
- 🎯 Simplified Management: Add or remove access from one central location
- 📊 Better Compliance: Meet security requirements with centralized audit logs
- 🔄 Automatic Provisioning: Users are created automatically on first login
Requirements
- Plan: Business or Enterprise subscription required
- Identity Provider: OIDC/OAuth 2.0 compatible provider (Okta, Azure AD, Google Workspace, Auth0, etc.)
- Role: Workspace Owner or Admin permissions
Quick Start Guide
Step 1: Access SSO Settings
- Log in to Contextium as a workspace Owner or Admin
- Navigate to Settings → SSO
- You'll see the SSO configuration page
If you're not on a Business or Enterprise plan, you'll see an upgrade prompt.
Step 2: Choose Your Provider
Contextium supports all OIDC/OAuth 2.0 compatible providers:
- Azure AD (Microsoft Entra ID)
- Okta
- Google Workspace
- Auth0
- Generic OIDC (for other providers)
Select your provider type from the dropdown or choose "Generic OIDC" for any standard OIDC provider.
Step 3: Configure Your Provider
You'll need the following information from your identity provider:
- Client ID: Your application's client identifier
- Client Secret: Your application's secret key
- Issuer/Discovery URL: The OIDC discovery endpoint
- Allowed Domains: Email domains that can use SSO (e.g.,
company.com)
Provider-Specific Setup Guides
Setting Up with Google Workspace
Step 1: Create OAuth 2.0 Client in Google Cloud
- Go to Google Cloud Console
- Select your project (or create a new one)
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Choose Web application as the application type
- Add authorized redirect URI:
(Use your API URL if self-hosting)https://app.contextium.io/api/v1/auth/sso/callback - Click Create and save your Client ID and Client Secret
Step 2: Configure in Contextium
- In Contextium SSO settings, select Google Workspace
- Enter your Client ID and Client Secret
- Set Issuer URL to:
https://accounts.google.com - Add your email domain (e.g.,
yourcompany.com) - Configure role mappings (optional)
- Enable Auto-provision users
- Click Save Configuration
Step 3: Test the Connection
- Click Test Configuration to verify settings
- If successful, toggle Enable SSO
- Test login with a user from your domain
Setting Up with Azure AD (Microsoft Entra ID)
Step 1: Register Application in Azure
- Go to Azure Portal
- Navigate to Azure Active Directory → App registrations
- Click New registration
- Set application name:
Contextium SSO - Set supported account types: Accounts in this organizational directory only
- Add Redirect URI (Web):
https://app.contextium.io/api/v1/auth/sso/callback - Click Register
Step 2: Configure Application
- Copy the Application (client) ID
- Go to Certificates & secrets
- Click New client secret
- Add description and expiry
- Copy the secret Value (you won't see it again!)
- Go to Token configuration
- Add optional claims for
emailandname
Step 3: Configure in Contextium
- In Contextium SSO settings, select Azure AD
- Enter your Client ID and Client Secret
- Set Issuer URL to:
Replacehttps://login.microsoftonline.com/YOUR_TENANT_ID/v2.0YOUR_TENANT_IDwith your Azure AD tenant ID - Add your email domain (e.g.,
company.com) - Set Role Claim Path to
roles(if using Azure AD roles) - Configure role mappings
- Enable Auto-provision users
- Click Save Configuration
Step 4: Test the Connection
- Click Test Configuration
- Enable SSO after successful test
- Test login with an Azure AD user
Setting Up with Okta
Step 1: Create OIDC Application in Okta
- Log in to your Okta Admin Console
- Go to Applications → Applications
- Click Create App Integration
- Select OIDC - OpenID Connect
- Choose Web Application
- Set application name:
Contextium SSO - Add Sign-in redirect URI:
https://app.contextium.io/api/v1/auth/sso/callback - Choose Controlled access settings
- Click Save
Step 2: Configure Application Settings
- Copy the Client ID and Client Secret
- Go to Assignments tab
- Assign users or groups who should have access
- (Optional) Go to Sign On tab → OpenID Connect ID Token to add custom claims
Step 3: Configure in Contextium
- In Contextium SSO settings, select Okta
- Enter your Client ID and Client Secret
- Set Issuer URL to:
Replacehttps://YOUR_DOMAIN.okta.comYOUR_DOMAINwith your Okta domain - Add your email domain (e.g.,
company.com) - Set Role Claim Path to
groups(if using Okta groups) - Configure role mappings
- Enable Auto-provision users
- Click Save Configuration
Step 4: Test the Connection
- Click Test Configuration
- Enable SSO after successful test
- Test login with an Okta user
Setting Up with Auth0
Step 1: Create Application in Auth0
- Log in to your Auth0 Dashboard
- Go to Applications → Applications
- Click Create Application
- Choose Regular Web Applications
- Go to Settings tab
- Add Allowed Callback URLs:
https://app.contextium.io/api/v1/auth/sso/callback - Copy your Client ID and Client Secret
Step 2: Configure in Contextium
- In Contextium SSO settings, select Auth0
- Enter your Client ID and Client Secret
- Set Issuer URL to:
Replacehttps://YOUR_DOMAIN.auth0.com/YOUR_DOMAINwith your Auth0 domain - Add your email domain (e.g.,
company.com) - Configure role mappings (if using Auth0 roles)
- Enable Auto-provision users
- Click Save Configuration
Step 3: Test the Connection
- Click Test Configuration
- Enable SSO after successful test
- Test login with an Auth0 user
Setting Up with Generic OIDC Provider
For any other OIDC-compatible provider:
- In Contextium SSO settings, select Generic OIDC
- Enter your provider's:
- Client ID
- Client Secret
- Issuer/Discovery URL (usually ends with
/.well-known/openid-configuration)
- Add your email domain
- Configure role mappings (if supported)
- Enable Auto-provision users
- Click Save Configuration
- Test and enable
Advanced Configuration
Role Mapping
Map groups or roles from your identity provider to Contextium workspace roles:
Contextium Roles:
- Admin: Full workspace management access
- Editor: Can create and edit content
- Viewer: Read-only access
Example Mapping:
Azure AD Group → Contextium Role
"Engineering-Admins" → Admin
"Engineering-Devs" → Editor
"Engineering-Contractors" → Viewer
Configuration:
- Set Role Claim Path to the claim containing groups/roles (e.g.,
groups,roles) - Configure Role Mappings in JSON format:
{ "admin": ["Engineering-Admins", "IT-Admins"], "editor": ["Engineering-Devs", "Product-Team"], "viewer": ["Contractors", "Guests"] } - Set Default Role for users without matching groups
Require SSO
When enabled, users with email addresses in the allowed domains must use SSO and cannot use password login.
To enable:
- Configure and test SSO first
- Enable the Require SSO toggle
- Users with matching domains will be forced to use SSO login
Important: Make sure SSO is working correctly before enabling this option!
Auto-Provisioning
When enabled, users logging in via SSO for the first time will automatically:
- Get a Contextium account created
- Be added to the workspace
- Receive the appropriate role based on role mappings
To disable auto-provisioning:
- Uncheck Auto-provision users
- Only existing workspace members can log in via SSO
- You must manually invite new users first
Security Best Practices
1. Test Before Enabling
Always test your SSO configuration before enabling it for all users:
- Click Test Configuration button
- Verify successful authentication
- Check user attributes are correct
- Confirm role mapping works as expected
2. Use Specific Domains
Only add email domains your organization owns to Allowed Domains:
- ✅ Good:
yourcompany.com - ❌ Bad:
gmail.com,outlook.com
3. Rotate Secrets Regularly
- Update your Client Secret periodically
- Use your identity provider's secret rotation features
- Update the secret in Contextium after rotation
4. Monitor Audit Logs
Check the SSO Audit Logs regularly for:
- Failed login attempts
- Unusual authentication patterns
- Blocked access attempts
5. Configure Role Mappings
- Use least-privilege principle
- Set a conservative Default Role (Viewer)
- Only grant Admin/Editor to specific groups
Troubleshooting
Error: "SSO authentication failed"
Possible causes:
- Incorrect Client ID or Secret
- Invalid Issuer URL
- User's email domain not in Allowed Domains
- Application not assigned to user in IdP
Solutions:
- Verify Client ID and Secret are correct
- Check Issuer URL format (should include
https://) - Confirm user's email domain is in Allowed Domains
- Ensure user is assigned to the application in your IdP
Error: "Email domain not allowed"
Cause: User's email domain is not in the Allowed Domains list
Solution:
- Go to SSO Settings
- Add the user's domain to Allowed Email Domains
- Save configuration
Error: "User not found"
Cause: Auto-provisioning is disabled and user doesn't exist
Solutions:
- Enable Auto-provision users in SSO settings, OR
- Manually invite the user to the workspace first
Users Can't See Roles/Permissions
Cause: Role mapping not configured correctly
Solutions:
- Check Role Claim Path matches your IdP's claim name
- Verify group names in Role Mappings match exactly
- Check user is a member of the expected group in your IdP
- Set appropriate Default Role as fallback
SSO Works But Wrong Role Assigned
Cause: Role mapping configuration issue
Solutions:
- Verify the group names in your role mappings match exactly
- Check the Role Claim Path (common values:
groups,roles,custom.groups) - Review the user's groups in your IdP
- Check audit logs to see what groups were received
Getting Help
If you need assistance with SSO setup:
- Check Audit Logs: Review recent SSO login attempts in Settings → SSO → Audit
- Documentation: Review your identity provider's OIDC documentation
- Support: Contact Contextium support with:
- Identity provider name
- Error messages from audit logs
- Steps you've already tried
FAQ
Q: Can I use multiple SSO providers? A: Currently, one SSO provider per workspace is supported.
Q: What happens to existing passwords when SSO is enabled? A: Existing passwords remain active unless you enable "Require SSO". Users can still log in with passwords if SSO is not required.
Q: Can users have both SSO and password login? A: Yes, unless "Require SSO" is enabled. When not required, users can choose either login method.
Q: What happens if SSO goes down? A: If "Require SSO" is not enabled, users can still log in with passwords. Workspace admins can always access the workspace to disable SSO if needed.
Q: Do I need to manually create users? A: No, if auto-provisioning is enabled. Users are automatically created on their first SSO login.
Q: Can I test SSO without affecting my team? A: Yes! SSO is not required by default. You can test with your own account before enabling it for everyone.
Q: Is SSO available on all plans? A: SSO is available on Business and Enterprise plans only. Upgrade your plan to access SSO.
Next Steps
After setting up SSO:
- ✅ Test login with your own account
- ✅ Enable SSO for your workspace
- ✅ Notify your team about the new login option
- ✅ (Optional) Enable "Require SSO" after confirming it works
- ✅ Monitor audit logs for any issues
Need help? Contact support@contextium.io or visit our Help Center.