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
1
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.
2
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.
3
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.
4
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.
5
Add the email claim
Go to Token configuration → Add optional claim → select ID token type → check email → Add.
6
Fill in CoPilot
Back in CoPilot under the Azure Entra ID section:
- Toggle Enable Azure SSO to on.
- Paste the Tenant ID, Client ID, and Client Secret.
- Confirm the Redirect URI matches what you set in Azure.
- Click Save SSO Settings.
1
Create OAuth credentials
Go to Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth client ID.
- Application type: Web application
- Authorized redirect URIs: add:
2
Copy credentials
Copy the Client ID and Client Secret shown after creation.
3
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.
4
Fill in CoPilot
Under the Google (OAuth2 / OIDC) section:
- Toggle Enable Google SSO to on.
- Paste the Client ID and Client Secret.
- Confirm the Redirect URI.
- Click Save SSO Settings.
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.
1
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.
2
Copy the Application Audience
After creating the app open it → Overview → copy the Application Audience (AUD) Tag.
3
Copy your Team Domain
Go to Settings → Custom Pages and copy your team domain (e.g.
myteam.cloudflareaccess.com).4
Fill in CoPilot
Under the Cloudflare Access (JWT Assertion) section:
- Toggle Enable Cloudflare Access to on.
- Paste the Team Domain and Application Audience (AUD).
- Click Save SSO Settings.
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.
To remove an email, click the delete button in the row.
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
The state token is stateless — it encodes a timestamp and is signed with HMAC-SHA256. It expires after 10 minutes.
