Auth0 SSO Setup Guide
This guide walks you through configuring Auth0 as your Identity Provider (IdP) for CRA Evidence single sign-on.
Overview
Auth0 provides robust SAML 2.0 support that integrates with CRA Evidence's SSO system. This guide covers the free and paid tier configurations.
What You'll Configure
- SAML SSO: Full single sign-on with automatic user provisioning
- JIT Provisioning: Users automatically created on first login
- Attribute Mapping: User profile sync from Auth0
Auth0 Plan Considerations
| Feature | Free Tier | Paid Tiers | Enterprise |
|---|---|---|---|
| SAML SSO | Yes | Yes | Yes |
| SAML Applications | Up to 5 | Varies | Unlimited |
| Custom Domains | No | Yes | Yes |
| Actions/Rules | Yes | Yes | Yes |
| SCIM Provisioning | No | No | Yes |
Note: SCIM (System for Cross-domain Identity Management) for automated user provisioning and deprovisioning requires Auth0 Enterprise plan. This guide focuses on SAML SSO, which works with all Auth0 plans.
Prerequisites
- Auth0 account (Sign up at auth0.com)
- CRA Evidence organisation admin access
- Your company email domain (e.g.,
company.com)
Step 1: Get CRA Evidence SP Information
Before configuring Auth0, gather the Service Provider (SP) information from CRA Evidence:
- Log in to CRA Evidence as an organisation admin
- Go to Settings > Single Sign-On
- Note the following values:
- Entity ID (Issuer):
https://app.craevidence.com - ACS URL:
https://app.craevidence.com/api/v1/saml/acs - Metadata URL:
https://app.craevidence.com/api/v1/saml/metadata
- Entity ID (Issuer):
Step 2: Create Auth0 Application
- Log in to your Auth0 Dashboard (https://manage.auth0.com)
- Navigate to Applications > Applications
- Click + Create Application
- Configure the application:
- Name:
CRA Evidence - Choose an application type: Regular Web Applications
- Name:
- Click Create
Step 3: Enable SAML2 Web App Addon
- In your CRA Evidence application, go to the Addons tab
- Find SAML2 WEB APP and click to enable it
- A configuration modal will appear
Settings Tab
In the Settings tab of the SAML2 addon, configure:
| Field | Value |
|---|---|
| Application Callback URL | https://app.craevidence.com/api/v1/saml/acs |
| Audience | https://app.craevidence.com |
Settings JSON (Advanced)
In the settings JSON, paste the following configuration:
{
"audience": "https://app.craevidence.com",
"mappings": {
"email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"given_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"family_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"
},
"nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"nameIdentifierProbes": [
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
]
}
Click Save (or Enable if first time).
Step 4: Get Auth0 IdP Information
After enabling the SAML addon:
- In the SAML2 addon modal, go to the Usage tab
- You will find:
- Identity Provider Login URL - Your SSO URL
- Issuer - Your IdP Entity ID
- Identity Provider Certificate - Download this
Alternatively, download the Identity Provider Metadata XML file which contains all values.
Extracting Values from Metadata
If you download the metadata XML, look for:
| CRA Evidence Field | XML Element |
|---|---|
| Entity ID | entityID attribute in <EntityDescriptor> |
| SSO URL | Location attribute in <SingleSignOnService> with HTTP-Redirect binding |
| Certificate | Content inside <X509Certificate> |
Example Entity ID format:
urn:your-tenant.auth0.com
Example SSO URL format:
https://your-tenant.auth0.com/samlp/CLIENT_ID
Step 5: Configure CRA Evidence
- In CRA Evidence, go to Settings > Single Sign-On
- Click Add Identity Provider
- Fill in the form:
| Field | Value |
|---|---|
| Name | Auth0 (or your preferred name) |
| Vendor | Generic SAML 2.0 |
| Entity ID | The "Issuer" from Auth0 (e.g., urn:your-tenant.auth0.com) |
| SSO URL | The "Identity Provider Login URL" from Auth0 |
| SLO URL | (optional) Auth0 logout URL if needed |
| X.509 Certificate | Paste the downloaded certificate content |
Provisioning Settings:
| Field | Recommended Value |
|---|---|
| JIT Provisioning | Enabled |
| Default Role | Member |
| Update on Login | Enabled |
- Click Add Identity Provider
Step 6: Add SSO Domain
- In CRA Evidence SSO settings, go to Domains
- Click Add Domain
- Enter your email domain (e.g.,
company.com) - Select the Auth0 IdP you just created
- Click Add Domain
Verify Domain Ownership
- Add a DNS TXT record:
- Host/Name:
_craevidence-verification - Value: (the verification token shown in CRA Evidence)
- Host/Name:
- Wait for DNS propagation (up to 48 hours)
- Click Verify Now in CRA Evidence
Step 7: Configure Auth0 Users
Auth0 offers multiple ways to manage users:
Option A: Auth0 Database (Default)
Users can sign up directly or be created in Auth0 Dashboard:
- Navigate to User Management > Users
- Click + Create User
- Enter email and password
- Users will authenticate via Auth0's login page
Option B: Social Connections
Enable Google, Microsoft, GitHub, etc.:
- Go to Authentication > Social
- Enable desired connections
- Users can login with these providers through Auth0
Option C: Enterprise Connections
Connect to your company directory:
- Go to Authentication > Enterprise
- Configure Active Directory, LDAP, or other SAML IdPs
- Auth0 acts as an identity broker
Step 8: Test SSO
- Open a new incognito/private browser window
- Go to
https://app.craevidence.com/login - Enter an email address from your SSO domain
- You should be redirected to Auth0's login page
- Authenticate with your credentials
- You should be redirected back to CRA Evidence, logged in
Optional: Enable SSO Enforcement
Once testing is successful, you can require SSO for all users:
- Go to Settings > Single Sign-On > Enforcement
- Enable Require SSO for all users
- Optionally enable Allow admins to bypass SSO
- Click Save Settings
Advanced: Auth0 Actions for Custom Claims
Auth0 Actions allow you to customize the SAML assertion with additional user data.
Add Custom Attributes
- In Auth0 Dashboard, go to Actions > Library
- Click + Create Action and select Build from scratch
- Name it:
CRA Evidence SAML Attributes - Select Trigger: Login / Post Login
Example Action code:
exports.onExecutePostLogin = async (event, api) => {
// Only apply to CRA Evidence SAML application
if (event.client.name !== 'CRA Evidence') return;
// Add custom attributes to SAML assertion
api.samlResponse.setAttribute('department', event.user.app_metadata?.department || '');
api.samlResponse.setAttribute('employee_id', event.user.app_metadata?.employee_id || '');
// Add roles if defined in user metadata
const roles = event.user.app_metadata?.roles || ['member'];
api.samlResponse.setAttribute('roles', roles.join(','));
};
- Click Deploy
- Go to Actions > Flows > Login
- Drag your new Action into the flow
- Click Apply
Role Mapping Example
To map Auth0 roles to CRA Evidence roles:
exports.onExecutePostLogin = async (event, api) => {
if (event.client.name !== 'CRA Evidence') return;
// Map Auth0 roles to CRA Evidence roles
const auth0Roles = event.authorization?.roles || [];
let craVaultRole = 'member'; // default
if (auth0Roles.includes('cra-evidence-admin')) {
craVaultRole = 'admin';
} else if (auth0Roles.includes('cra-evidence-viewer')) {
craVaultRole = 'viewer';
}
api.samlResponse.setAttribute('cra_evidence_role', craVaultRole);
};
Testing Checklist
Before rolling out to all users, verify:
- [ ] SSO Login Flow: Users can log in via Auth0 and access CRA Evidence
- [ ] JIT Provisioning: New users are created on first login
- [ ] User Attributes: Name and email sync correctly to CRA Evidence
- [ ] Logout: Users can sign out (both SP and IdP initiated)
- [ ] Error Handling: Invalid credentials show appropriate error
- [ ] Domain Routing: Email domain correctly triggers SSO flow
Troubleshooting
"Invalid SAML Response" Error
Causes and Solutions:
- ACS URL mismatch: Verify the Callback URL in Auth0 exactly matches
https://app.craevidence.com/api/v1/saml/acs - Audience mismatch: Ensure Audience is set to
https://app.craevidence.com - Certificate issue: Re-download the certificate from Auth0 and update in CRA Evidence
"Unable to validate signature" Error
- Download a fresh certificate from Auth0 (Usage tab in SAML addon)
- Ensure you're copying the full certificate including
-----BEGIN CERTIFICATE-----and-----END CERTIFICATE----- - Check that no extra whitespace or line breaks were added
User Not Being Created
- Confirm JIT Provisioning is enabled in CRA Evidence IdP settings
- Verify the email attribute is being sent (check Auth0 logs)
- Ensure the user has an email address in Auth0
Auth0 Login Page Shows "Unauthorized"
- In Auth0, go to Applications > CRA Evidence > Connections
- Ensure at least one connection (Database, Social, or Enterprise) is enabled
- Verify the user exists in an enabled connection
"Domain Not Configured" in CRA Evidence
- Verify the domain is added and verified in CRA Evidence SSO settings
- Check exact spelling (e.g.,
company.comvsCompany.com) - Ensure DNS verification is complete
Clock Skew Errors
- Auth0 servers are time-synchronized, but your browser or CRA Evidence server might have clock drift
- CRA Evidence allows up to 2 minutes of clock drift by default
- Contact support if issues persist
Debugging with Auth0 Logs
- In Auth0 Dashboard, go to Monitoring > Logs
- Filter by your CRA Evidence application
- Look for
Success LoginorFailed Loginevents - Click on an event for detailed information including SAML assertion
Security Recommendations
- Enable MFA in Auth0: Go to Security > Multi-factor Auth to require additional verification
- Configure Brute Force Protection: Enabled by default in Auth0
- Set Up Anomaly Detection: Auth0 can detect suspicious login patterns
- Use Custom Domain (Paid plans): Presents your domain instead of
*.auth0.com - Review Connection Settings: Only enable authentication methods you need
Upgrading to Enterprise
Auth0 Enterprise plan adds:
- SCIM Provisioning: Automatic user provisioning and deprovisioning with CRA Evidence
- Advanced SAML Options: Including encrypted assertions
- Custom Enterprise Connections: Full LDAP/AD integration
- Extended SLAs and Support: Priority support channels
- SSO Dashboard: Centralized SSO management
For SCIM integration with CRA Evidence, contact your Auth0 representative and refer to the CRA Evidence SCIM documentation once upgraded.
Reference
Auth0 SAML Configuration Summary
| Setting | Value |
|---|---|
| Application Callback URL | https://app.craevidence.com/api/v1/saml/acs |
| Audience (SP Entity ID) | https://app.craevidence.com |
| Name ID Format | emailAddress |
| Signature Algorithm | SHA-256 (default) |
Expected SAML Attributes
| Attribute | Description | Required |
|---|---|---|
email / emailaddress |
User's email address | Yes |
name / displayName |
User's full name | Recommended |
given_name / firstName |
User's first name | Optional |
family_name / lastName |
User's last name | Optional |
Support
If you encounter issues:
- Check the SAML SSO Architecture documentation
- Review Auth0 logs for detailed error information
- Contact CRA Evidence support at support@craevidence.com
- Provide:
- Error message shown
- Screenshot of Auth0 SAML addon configuration
- Auth0 log entry for the failed login attempt
- CRA Evidence IdP configuration (without certificate)
Help us improve. What was missing or unclear?