| Provider | Protocol | How it works |
|---|---|---|
| Azure Entra ID | OAuth 2.0 / OIDC | User is redirected to Microsoft, then back to CoPilot with an authorization code. |
| OAuth 2.0 / OIDC | Same redirect flow via Google accounts. | |
| Cloudflare Access | JWT assertion | Cloudflare sits in front of CoPilot and injects a signed header; no redirect needed from the user’s perspective. |
How SSO login works
Auto-provisioning: The first time an allowed email logs in via SSO, CoPilot automatically creates a local user account with the role you assigned in the allowlist. No manual user creation is required.
Prerequisites
- Your CoPilot instance must be reachable at a stable URL (HTTPS recommended).
- You need admin access in CoPilot.
- You need admin access to the identity provider you want to configure (Azure portal, Google Cloud Console, or Cloudflare Zero Trust dashboard).
Step 1 — Enable SSO globally
- Go to Users in the top navigation.
- Scroll to the Single Sign-On (SSO) Configuration card.
- Toggle Enable SSO to on.
This toggle controls whether SSO login buttons appear on the login page. You can enable the global toggle and then selectively enable individual providers.
Step 2 — Configure a provider
Azure Entra ID
Register an application in Azure
Go to portal.azure.com → Azure Active Directory → App registrations → New registration.
- Name: e.g.
CoPilot SSO - Supported account types: Accounts in this organizational directory only
- Click Register.
Copy IDs
From the app’s Overview page:
- Copy the Application (client) ID → you will paste this as Client ID in CoPilot.
- Copy the Directory (tenant) ID → you will paste this as Tenant ID in CoPilot.
Create a client secret
Go to Certificates & secrets → New client secret. Copy the Value (not the Secret ID) → you will paste this as Client Secret in CoPilot.
Set the redirect URI
Go to Authentication → Add a platform → Web. Set the redirect URI to:
Tip: In CoPilot, the Auto-fill button next to the Redirect URI field will populate this automatically based on your current domain.
Add the email claim
Go to Token configuration → Add optional claim → select ID token type → check email → Add.
Create OAuth credentials
Go to Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth client ID.
- Application type: Web application
- Authorized redirect URIs: add:
Enable People API
In the Cloud Console go to APIs & Services → Library → search for People API → Enable. This is required for CoPilot to retrieve the user’s email and profile.
Cloudflare Access
Cloudflare Access works differently from the other providers. Instead of redirecting the user, Cloudflare sits in front of CoPilot as a reverse proxy and injects a cryptographically signed JWT header (Cf-Access-Jwt-Assertion) into every request. CoPilot verifies this header — it is impossible to forge without Cloudflare’s private key.
Create a Cloudflare Access application
In the Cloudflare Zero Trust dashboard go to Access → Applications → Add an application → Self-hosted.
- Set the domain to your CoPilot URL (e.g.
copilot.example.com). - Connect your identity provider (e.g. Entra ID, Google, GitHub) under Identity providers.
Copy the Application Audience
After creating the app open it → Overview → copy the Application Audience (AUD) Tag.
Copy your Team Domain
Go to Settings → Custom Pages and copy your team domain (e.g.
myteam.cloudflareaccess.com).With Cloudflare Access there is no client secret — authentication is handled entirely by the signed JWT header.
Step 3 — Manage the email allowlist
SSO users can only log in if their email address is in the SSO Allowed Emails list. This prevents unauthorized accounts in your identity provider from accessing CoPilot.- Scroll to the SSO Allowed Emails card (below the SSO configuration card).
- Click Add Email.
- Enter the user’s email address and select a role:
- Admin — full platform access
- Analyst (default) — standard operator access
- Click Add Email.
| Column | Description |
|---|---|
| The email address permitted to log in via SSO. | |
| Role | The CoPilot role assigned on first login. |
| Added | Timestamp of when the entry was created. |
Important: Only emails in this list can log in via SSO. If a user’s email is not listed, they will be denied access even if they authenticate successfully with the identity provider.
How SSO interacts with 2FA
If a user has two-factor authentication enabled on their CoPilot account, SSO login will still require the second factor:- User authenticates via the identity provider.
- CoPilot verifies the SSO token and finds that the user has 2FA enabled.
- The user is prompted for their TOTP code (or a backup code) before the session is created.
Environment variables
| Variable | Purpose | Default |
|---|---|---|
SSO_STATE_SECRET | HMAC key used to sign OAuth2 state tokens (prevents CSRF). | Falls back to JWT_SECRET |
The state token is stateless — it encodes a timestamp and is signed with HMAC-SHA256. It expires after 10 minutes.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| SSO buttons don’t appear on the login page | Global SSO toggle is off, or no individual provider is enabled. | Enable SSO globally and enable at least one provider. |
| ”Email not in allowed list” after SSO login | The user’s email is not in the SSO Allowed Emails list. | Add the email address to the allowlist. |
| Azure callback fails with “invalid redirect URI” | Redirect URI in Azure app registration doesn’t match CoPilot. | Copy the redirect URI from CoPilot (use Auto-fill) and paste it exactly into Azure. |
| Google callback fails | People API not enabled or redirect URI mismatch. | Enable the People API in Google Cloud Console and verify the redirect URI. |
| Cloudflare “authentication failed” | CoPilot is not behind Cloudflare Access, or the AUD/team domain is wrong. | Ensure traffic goes through Cloudflare Access and double-check the AUD tag and team domain. |
