CodeHerderSearch⌘KCtrl KGet started →

Single sign-on (SAML and OIDC)

Connect your identity provider so people sign in to CodeHerder through your own SAML or OIDC setup, such as an Amazon Cognito user pool, on the Enterprise plan.

Single sign-on (SSO) lets your identity provider (IdP) authenticate people signing in to CodeHerder, in place of the usual email sign-in. It’s available on the Enterprise plan — see Plans and limits. On any other plan, the SSO page shows an upgrade banner with a Contact sales link instead of the setup form.

This connection also carries automatic user provisioning, a separate Enterprise entitlement that lets your identity provider create and deactivate accounts for you instead of you inviting people by hand — see Automatic user provisioning (SCIM).

Where it lives

Open Settings → SSO. No ch command manages a connection. Create, enable, disable and delete a connection, and claim its domains, in the web app. The CLI has one SSO command, ch login --sso, which signs you in through a connection. See How people sign in. A few changes have no web-app control and go through a direct request instead — see Changing a connection through the API.

Who can set it up

Only an owner or admin of your account’s top-level workspace can set this up, and only a person acting with their own credentials. An agent, or any session’s credential, is refused. If you open Settings → SSO from a workspace nested under a group, you’re still looking at that top-level workspace’s connection — an account holds a single connection, shared by every workspace inside it, not one per nested workspace. A member sees a read-only view with a notice that only an owner or admin can manage it.

An account holds one connection at a time. The SSO page shows New connection only when the account has no connection at all, and a disabled connection still counts. To replace a connection in the web app, Delete the old one first (see Changing, disabling, and removing a connection).

Creating the connection

Click New connection and pick a Protocol:

  • SAML — your identity provider publishes SAML metadata (Okta, Entra ID, ADFS and most enterprise IdPs).
  • OIDC — your identity provider issues OpenID Connect tokens but is not a SAML IdP. An Amazon Cognito user pool is the common case. See Connecting an OIDC identity provider below.

You can’t change the protocol later. For SAML, fill in three fields:

  • Provider name — a label for the connection, 3–32 characters. The first character must be a letter or digit; the rest can also include hyphens and underscores. It must be unique across all of CodeHerder, not just your own account — if a name you expected to be free is refused, someone else has already taken it. It also can’t be a reserved identity-provider name, in any letter case: Google, Microsoft, GitHub, Facebook, Login with Amazon, Sign in with Apple (written as one word, such as LoginWithAmazon) or Cognito. It can’t start with one of those names followed by a hyphen or underscore either — google-corp is refused, but googlecorp is accepted. A name that starts with “Cognito” is always refused.
  • IdP metadata — either a Metadata URL your identity provider publishes, or a Metadata XML document you upload directly. Provide exactly one; you can’t set both.
  • Email verified attribute (optional) — the name of the SAML attribute your identity provider asserts to say an email address is verified: up to 128 characters, printable ASCII only, with no spaces, quotes, or backslashes. You can leave it blank. Sign-in doesn’t need it. CodeHerder trusts an email address when its domain is verified on your active connection, whatever this attribute says. See Who can sign in through your connection.

Saving creates the connection in pending state — it doesn’t accept sign-ins yet.

Connecting an OIDC identity provider

Do the steps in your identity provider first. That is where the client ID and secret come from.

In your identity provider (an Amazon Cognito user pool shown as the example):

  1. Create an app client for CodeHerder. It must be a confidential client with a client secret.
  2. Allow only the Authorization code grant.
  3. Allow the scopes openid, email and profile.
  4. Add the Callback URL shown on CodeHerder’s OIDC form to the app client’s allowed callback URLs. It looks like https://<sign-in host>/oauth2/idpresponse. It must match exactly.

In CodeHerder, choose OIDC and fill in:

  • Provider name — the same rules as for SAML, above.
  • Issuer URL — your identity provider’s OpenID Connect issuer. For a Cognito pool it is https://cognito-idp.<region>.amazonaws.com/<pool id>, for example https://cognito-idp.us-west-2.amazonaws.com/us-west-2_AbC123xyz. Use the issuer even if your pool has a custom sign-in domain. Don’t paste the /.well-known/openid-configuration URL.
  • Client ID and Client secret — from the app client you just created. CodeHerder stores the secret encrypted and never shows it again.

When you save, CodeHerder reads your issuer’s discovery document and signing keys. If something is wrong, the form says exactly what. For example, the issuer doesn’t match, the address can’t be reached, or there is no signing key. Nothing is saved until the check passes. The connection starts pending, the same as SAML.

The connection page then shows the Callback URL again, the issuer, the client ID, and whether a client secret is stored. To change the issuer, client ID or secret, click Edit. Leave the secret blank to keep the stored one.

Claim and verify your email domain and click Enable, exactly as for SAML (below). For OIDC, CodeHerder doesn’t need the email_verified claim. The rules in Who can sign in through your connection apply.

Handing values to your identity provider

This section is for SAML. Once the connection exists, its page shows three values for your IdP admin to configure:

  • ACS URL — where your IdP sends its SAML response after authenticating someone.
  • Entity ID — the identifier your IdP uses for this connection.
  • Sign-in URL — a ready-to-use link for testing. It isn’t required by your IdP configuration, but see How people sign in below — you’ll likely want to distribute this link yourself.

Each value is copyable straight from the page. If your deployment has no single-sign-on hosting configured, all three show “Not available” instead — ask whoever runs your deployment to enable it.

With your IdP configured against those values, click Enable to move the connection from pending to active and start accepting sign-ins. Disable reverses this at any time and asks you to confirm — it stops routing sign-ins through the connection immediately.

A separate Provisioning indicator on the page (unprovisioned / provisioned / error) reports whether the underlying sign-in service currently has a working provider set up — it’s not the same thing as the connection’s State above, and an error there is shown with its own banner.

Claiming and verifying a domain

Claiming a domain proves you control it — and verifying it is what lets people with that email domain sign in through your connection. See Who can sign in through your connection. To claim one:

  1. Click Claim domain on the SSO page and enter the domain. CodeHerder shows a DNS TXT record to publish: name _codeherder-sso.<your-domain>, value ch-verify=<a token>. Only owners and admins see the value; anyone else sees the name and “Ask an owner or admin for the record value.”
  2. Publish that record with your DNS provider.
  3. Click Verify on the domain’s row. Once a domain is verified, the same button reads Check again.

A few things worth knowing:

  • To remove a claimed domain, open the More menu on its row and choose Delete.
  • Public email domains (gmail.com, outlook.com, and similar free or disposable providers) can never be claimed, no matter what DNS says.
  • Verification is first-come: whichever account verifies a domain first keeps it, and no other connection — on any account — can claim it afterward, even if another account typed it in first.
  • Can’t publish the TXT record? Ask whoever runs your deployment. They can verify a domain for you another way. CodeHerder doesn’t recheck a domain verified that way.
  • Leave the TXT record published after verifying. CodeHerder rechecks verified domains periodically, and if a check genuinely finds the record missing three times in a row, the domain drops back to unverified. A DNS lookup that simply fails to complete doesn’t count against you — only a confirmed missing or wrong record does. While a domain is unverified, linked sign-ins on it stop working and new people can’t join through it. See below.

Who can sign in through your connection

One condition decides it: the connection is active, and the person’s email domain is verified on it. You don’t need the SAML email verified attribute or the OIDC email_verified claim. CodeHerder treats the email as verified because you proved you own the domain.

When that is true, one of three things happens, depending on who the person already is in CodeHerder:

  • They have an account but no sign-in yet. The SSO sign-in becomes their sign-in.
  • They already sign in another way, such as by email. SSO is linked as a second sign-in. They stay the same member. Their original sign-in and their history don’t change.
  • Nobody holds that email address, as a primary or a verified secondary. They join your account as a new member with the member role. CodeHerder takes the name from your identity provider. If it sends none, CodeHerder builds one from the email address. This doesn’t create a new account.

The address your identity provider sends can also match a verified secondary address on someone’s account. The connection must have verified that address’s domain. The SSO sign-in then links to that account, as in the second case above, and the person joins your account as a member. Your seat cap still applies. See Your email addresses.

If the domain isn’t verified, or the connection isn’t active, no one can make a first sign-in through the connection. No one can link an SSO sign-in or join your account that way either. Inviting someone again doesn’t fix this: an invitation creates an ordinary email sign-in and doesn’t change how an SSO sign-in is checked. Verify your domain before you send anyone the Sign-in URL.

CodeHerder checks a linked sign-in again each time the person signs in. The connection must still be active with the domain verified. The email your identity provider sends must still be one the person holds, as a primary or a verified secondary address. If either fails, CodeHerder refuses that SSO sign-in. Their original sign-in keeps working.

How people sign in

Distribute your connection’s Sign-in URL to the people who should use it — link it from your company intranet, your IdP’s own app dashboard, or a bookmark you send around. Following that link takes someone straight to your identity provider to authenticate, then back into CodeHerder.

The sign-in page never shows a button for your connection. On a deployment whose sign-in page has a corporate email field, someone can type their work email there instead. If its domain is verified on your connection, they go straight to your identity provider. Until a domain is verified, the Sign-in URL is the way in.

Someone who prefers the terminal runs ch login --sso with the connection’s Provider name:

ch login --sso acme-okta

This opens your browser, signs you in through your identity provider, and caches the credential like a plain ch login. Use it either for a first sign-in or to refresh your SSO session. You can’t combine it with --provider. See Credentials and profiles.

Requiring SSO

By default, SSO is one more way to sign in. Your members can still use their email sign-in. Require SSO makes SSO the only way to use the account. It is a Sign-in policy section on Settings → SSO, below the connection. Owners and admins of your account’s top-level workspace can edit it. Members see it read-only. Click Edit to change it. The page asks you to confirm each change that can lock people out.

The policy has three settings:

  • Require SSO — on or off. While it is on and the connection is active, a member needs a recent SSO sign-in to use the account.
  • Session window — how long an SSO sign-in counts as recent: 1 to 168 hours, 24 by default. When someone’s last SSO sign-in is older than the window, they sign in through SSO again. If you shorten the window, anyone whose sign-in is now older than the new window must sign in again.
  • SSO-only sign-in — on or off. You can turn it on only while Require SSO is on. Turning Require SSO off turns SSO-only sign-in off too. See SSO-only sign-in.

What Require SSO covers

The rule applies to a person acting as themselves in your account’s workspaces. That includes:

  • the web app,
  • a ch login credential,
  • a personal API key,
  • a connected app that uses an MCP connection.

These are exempt: agents and their keys, a credential bound to a running session, device tokens, and service credentials such as a SCIM token. An automated script that must keep working should use an agent key. See Minting API keys.

A revoke-all also ends a member’s SSO session. They sign in through SSO again. See Credentials and profiles.

What a member sees

A member without a recent SSO sign-in is refused with a 403 error, code sso_required:

  • The web app shows Sign in with SSO to continue and a link that starts the SSO sign-in.
  • ch prints Sign in with <account> SSO to continue: run ch login --sso <provider>. On a non-default server, the hint also carries --addr.
  • An API request gets the sso_required error.
  • A connected app gets the same error, with a sign-in link. See When your account requires SSO.

After the member signs in through SSO, the same request works.

Before you turn it on

  1. Verify your email domain and enable the connection. See Claiming and verifying a domain.
  2. Sign in through SSO yourself, with the Sign-in URL or ch login --sso, to confirm it works.
  3. Make sure at least one owner of the account can reach the SSO settings. See If your identity provider breaks.
  4. Move automation that runs as a person to an agent key.

SSO-only sign-in

With SSO-only sign-in on, a person whose verified primary or secondary email is on a verified domain of your active connection must sign in through that connection. Any other sign-in, such as email or Google, gets a 403 error, code sso_sign_in_required. Owners of the account’s top-level workspace are exempt.

If your identity provider breaks

When your identity provider stops working, nobody can get a fresh SSO sign-in. An owner of the account’s top-level workspace can still open Settings → SSO without one. They can repair the connection or turn Require SSO off. CodeHerder records an sso.break_glass_used event when an owner does this, at most once an hour per owner. An admin who isn’t an owner doesn’t get this access. Keep at least one owner who can reach it.

Changing, disabling, and removing a connection

Disabling. Disable stops routing sign-ins immediately, whether or not the underlying deprovisioning finishes right away. Your verified domains stay verified. Linked sign-ins stop working until you enable the connection again. People can still sign in the other way they used before.

Disabling or removing a person in CodeHerder turns off every sign-in they have, linked SSO ones included. See Taking someone’s access away. Disabling the connection also revokes its SCIM token. Enabling it again needs a new token — see Automatic user provisioning (SCIM).

Removing. Open the connection panel’s More menu and choose Delete. Deleting is permanent, and the web app asks you to confirm first. It releases every verified domain of the connection and revokes its SCIM token. Once the old connection is gone, New connection appears. If tearing down the connection’s live configuration fails partway through, the removal is refused and reported rather than leaving things half-cleaned-up — wait a moment and try again.

Changing a connection through the API

An OIDC connection has an Edit form in the web app. A SAML connection doesn’t. To rename a connection, replace its metadata, or change its email verified attribute, send a direct request with your own API key, as the SCIM guide does. List your connection first to find its id, using the request in that guide.

curl -X PATCH https://api.codeherder.com/v1/sso-connections/<connectionId> \
  -H "Authorization: Bearer $CH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"metadataXml": "<EntityDescriptor …>"}'

The body can carry these keys: providerName, metadataUrl, metadataXml and emailVerifiedAttribute for SAML, or providerName, oidcIssuer, oidcClientId and oidcClientSecret for OIDC. A key for the other protocol is refused.

  • Send exactly one metadata source. To switch from a URL to XML, send the new XML and set metadataUrl to "". To switch the other way, do the reverse.
  • A key CodeHerder doesn’t recognize is refused with a 400 error.
  • enabled is different: send it alone. A body that has enabled and another key is refused.
  • A rename is refused while the connection is active, or until deprovisioning finishes after a disable. Disable the connection, wait for it to settle, rename it, then enable it again.
  • A metadata or attribute change on an active connection applies at once.

When a certificate or SCIM token nears expiry

CodeHerder checks each night for two things: a SAML signing certificate in your connection’s metadata, and the connection’s SCIM token. It alerts you 30 days before either one expires, and again on the day it lapses. A self-hosted deployment can change the 30 days — see Self-hosted deployment.

  • Who is told. Every admin and owner of the workspace that owns the connection, and of its parent groups, gets one email per credential and stage. Only admins with a verified email address receive it. CodeHerder does not send the same alert twice. A new certificate or a new SCIM token has a new expiry, so it gets its own alerts.
  • The events. CodeHerder also records sso.credential_expiring and sso.credential_expired. Subscribe a webhook to them if you want the alert in your own tools.
  • Certificate. Send the new metadata XML with the request in Changing a connection through the API before the date.
  • SCIM token. Mint a new token with the request in Minting a token. Give it to your identity provider.
  • Metadata URL connections. CodeHerder does not check these. It stores no certificate for them, and your identity provider serves the current one.

The connection panel shows Certificate expires and SCIM token expires when those dates are known.

When it goes wrong

  • There is no New connection button. The account already has a connection, even if it is disabled. Delete it from the More menu, then create the new one. Deleting releases its verified domains and revokes its SCIM token.
  • Someone reaches your identity provider through the Sign-in URL but can’t get into your workspace. Check the condition in Who can sign in through your connection. Their email domain must be verified on this connection, and the connection must be active. Re-inviting them does not fix this.
  • Someone’s SSO sign-in stopped working, but their email sign-in still works. Their linked sign-in lapsed. The usual causes: the domain is no longer verified or was deleted, the connection is disabled, or the address your identity provider sends is no longer their primary or a verified secondary address, for example because they removed it. Fix the cause and they can use SSO again. Until then they can sign in the other way.
  • A request fails with sso_required. The account requires SSO and the person’s last SSO sign-in is older than the session window. Sign in again through SSO, with the web app link or ch login --sso <provider>. See Requiring SSO.
  • A sign-in fails with sso_sign_in_required. SSO-only sign-in is on and the person’s email is on a verified domain of your connection. They must use the Sign-in URL or ch login --sso <provider>.
  • A personal API key or script is suddenly refused. Require SSO covers keys that act as a person. Refresh the person’s SSO session, or move the script to an agent key.
  • Everyone is locked out. An owner opens Settings → SSO and turns Require SSO off. See If your identity provider breaks.
  • A domain won’t verify. Double check the exact TXT record name and value shown on the connection’s page — a small typo, or a record published under the wrong subdomain, is the usual cause. Public email domains never verify, by design.
  • Renaming is refused. The connection is still active, or still finishing a disable — wait for it to settle, then try again. Renaming is an API request.
  • All three configuration values read “Not available.” Single-sign-on hosting isn’t configured on your deployment; ask whoever runs it to enable it.
  • The Provisioning indicator shows an error. The connection’s State can still be active while Provisioning shows a problem — re-check your IdP configuration against the ACS URL and Entity ID, then disable and re-enable the connection to retry provisioning.

OIDC sign-in problems

  • The form says the OIDC discovery check failed. Read the message; it names the check. The usual causes are a wrong region or pool ID in the issuer, a trailing path, or pasting the discovery URL instead of the issuer.
  • Your identity provider shows redirect_mismatch. The app client’s callback URL isn’t exactly the Callback URL on the connection page.
  • Your identity provider says the client is not allowed, or a scope is invalid. Turn on the authorization code grant and the openid, email and profile scopes on the app client.
  • Sign-in fails after your identity provider accepts the password. The client secret or client ID is likely wrong. Click Edit and enter them again. Then check that the person’s email domain is verified on this connection and that the connection is active.
  • Enabling says the stored client secret can’t be read. Click Edit and enter the client secret again.

Last updated

Try it on one repository for two weeks.

File a task. An agent builds it. You see the cost of each task.

Try "pricing", "connect a device", or "who reviews the code"

↑↓ move · ↵ open · esc close