Enable SSO
Let an enterprise tenant sign in with their own identity provider over OIDC, and route their users by email domain. SAML 2.0 and SCIM provisioning are on the roadmap.
Single sign-on connects an organisation to its own identity provider (IdP) such as Okta, Entra ID or Google Workspace. Enterprise SSO over OIDC is live today; SAML 2.0 is on the roadmap. A connection belongs to one organisation, so each tenant manages its own login while your application sees the same OrthID session and actor model throughout.
1. Create the connection
Create an OIDC SSO connection on the organisation. You supply the issuer, client ID and client secret from the tenant’s IdP, and the domains whose users route to it. OrthID returns the redirect values to hand back to the IdP admin.
import { orthid } from "@orthid/sdk";
// OIDC connection for an organisation.
const connection = await orthid.sso.createConnection({
organizationId: "org_clinic_42",
protocol: "oidc",
name: "Entra ID (Acme Health)",
oidc: {
issuer: "https://login.microsoftonline.com/<tenant-id>/v2.0",
clientId: process.env.ACME_OIDC_CLIENT_ID,
clientSecret: process.env.ACME_OIDC_CLIENT_SECRET,
scopes: ["openid", "email", "profile"],
},
// Domains whose users are routed to this connection.
domains: ["acmehealth.com"],
});2. Route users by domain
The domains on a connection drive domain-based routing. When a user enters an email whose domain matches a verified connection, the hosted <SignIn/>skips the password step and sends them straight to their IdP. A domain must be verified by the organisation before it routes traffic, which stops one tenant from claiming another tenant’s users.
import { orthid } from "@orthid/sdk";
// Begin verification: returns a DNS TXT record to publish.
const { txtRecord } = await orthid.sso.startDomainVerification({
organizationId: "org_clinic_42",
domain: "acmehealth.com",
});
// txtRecord -> "orthid-verify=8c1f...": add it to the domain's DNS.
// Once the record is live, confirm it.
await orthid.sso.verifyDomain({
organizationId: "org_clinic_42",
domain: "acmehealth.com",
});3. Provision with SCIM (roadmap)
SCIM provisioning is planned, not yet shipping. The intent is to keep your tenant’s directory and OrthID in sync: when the IdP creates, updates or deactivates a user, OrthID would mirror the change, so a deprovisioned employee loses access without a manual step. The planned shape enables SCIM on a connection to get a base URL and a bearer token to paste into the IdP. Until SCIM lands, use email invitations or direct provisioning to manage membership.
import { orthid } from "@orthid/sdk";
// Planned API: enable SCIM on an existing connection.
const scim = await orthid.sso.enableScim({
connectionId: connection.id,
});
// Configure these in the IdP's provisioning settings.
console.log(scim.baseUrl);
console.log(scim.token); // bearer token, shown onceNext steps
- Invite members to add people who are not yet in the IdP, or to seed the first admins.
- Add MFA as a second factor for users who sign in without an enterprise IdP.