Status: approved design; slice S1 is in progress. This page describes target
behavior. Nothing on this page is enabled. The implemented SAML foundation (phases 1 to 4)
and its current, binding rules are in Outbound SSO to Claude.
Where the two pages disagree, that page describes what ships today.
Goal
A verified internal Tuturuuu account can sign into external systems without a separate password: Claude first, then GitHub Enterprise, Slack, Notion, Google Workspace-style apps and any SAML 2.0 or OpenID Connect relying party. Tuturuuu is the identity provider (IdP) here. This is the reverse of inbound enterprise sign-in to Tuturuuu, and it is separate from internal cross-app and satellite sessions. No Tuturuuu bearer, refresh token or Supabase session ever leaves Tuturuuu. “Seamless” means one Tuturuuu sign-in (with MFA) and then one click per app, including through an app launcher. “Secure” means the rules below fail closed.What exists today (inventory)
Pilot status: no client has been enabled, the flag is off, and no real Claude or
WorkOS login has been run. Phase 5 of the existing page, which covers rotation,
operator custody and real acceptance, is still open.
Verified claude.ai requirements (help center, read 2026-11-24)
- Claude uses WorkOS as its SSO broker. An Owner opens Organization settings → Authentication → Setup SSO and completes a WorkOS setup flow.
- Both SAML (X.509 signing certificate) and OpenID Connect (client secret) are supported, on Team, Enterprise and Console organizations.
- Domains must be verified with a DNS TXT record starting
anthropic-domain-verification-at the exact domain. All domains of a parent organization must use one IdP. - SCIM is Enterprise only, through WorkOS directory sync. Team plans get just-in-time (JIT) provisioning, and JIT never removes members.
- Require SSO for Claude makes every user on the domain use SSO. An expired certificate or secret then locks out everyone until Anthropic support helps. Deleting the connection signs out every user on the verified domains.
- IdP-initiated login is documented as unsupported for Console organizations. The help center does not state the exact WorkOS entity ID, ACS URL, NameID format or required attributes. Read them from the WorkOS setup flow at connection time.
Decisions proposed by this design
- SAML first, OIDC second. Claude accepts both, but SAML is already built and reviewed through phase 4. The first live connection is Claude over SAML. OIDC follows for relying parties that support only OIDC, or that prefer it (for example Notion or custom internal tools).
- Issuance stays in
apps/webon the Next.js Node runtime, where the active runtime policy puts live API and page behavior. Protocol and policy logic stays inpackages/sso, free of framework imports, so a later Worker port reuses it. Background work (SCIM push, key-expiry alerts, audit retention) goes to Cloudflare Workers, per the background work inventory. - Private signing keys never live in the database, and should not live in Vercel env either. Sign through a dedicated Cloudflare signer Worker that builds the assertion or token itself from structured, permit-checked input. It is never a raw signing oracle. A non-exportable KMS key behind the Worker is the stronger option. See Key custody and open decision D3.
- Eligibility is narrow by default. Only current MEMBERs of the selected
internal workspace can use SSO, with a confirmed email in an approved domain
(initially
tuturuuu.comonly), current MFA, and an explicit assignment to that app. Role-derived grants are a later, constrained option (S3). - No unsolicited (IdP-initiated) assertions by default. The app launcher opens each SP’s own SSO start URL (SP-initiated). Per-client IdP-initiated SAML is a later, explicit opt-in, and never for Claude.
- No single logout. Tuturuuu logout does not end SP sessions. Deprovisioning uses SCIM where the SP supports it, plus short assertion lifetimes and assignment revocation.
Eligibility and the application registry
An application is a row insso_clients with a protocol profile (SAML today,
OIDC added). Each belongs to one active non-personal workspace. Its fields:
Login eligibility is checked at admission, at consent, at consume and again after
signing:
- The Tuturuuu account is active, its email is confirmed, and the domain of the
fresh Auth email (not the profile email) is in the client’s approved
domains. The initial internal allowlist is exactly
tuturuuu.com. The domain must match exactly after lowercasing. Non-ASCII (IDN) domains are rejected, both in client domain lists and in Auth emails. Disabled or banned Auth accounts are denied. - The account is a current MEMBER of the client’s workspace. Guests, invitees and domain matches alone are not enough.
- The account has an active explicit assignment for the client. The binding
rule in Outbound SSO to Claude still applies:
rejoining or promotion needs a new assignment. Role-derived grants (S3) need
all of the following, plus an explicit amendment of that page:
- they apply only to roles whose membership changes themselves require
manage_sso_clients; - consume and
sso_finalize_issuancelock the role-membership rows, as they lock assignments today, with a pgTAP race for it; - every role-derived grant is audited.
- they apply only to roles whose membership changes themselves require
- The account’s factor-bound TOTP proof is no older than the client’s
mfa_max_age(see D2). Age is measured from the proof time, never from the session’s aal2 or a refreshiat.mfa_max_agedefaults to 600 seconds. A manager with a current MFA proof can raise it to at most 12 hours. A client marked high-privilege (GitHub Enterprise, admin consoles) is capped at 600 seconds by schema.ForceAuthnand OIDCprompt=loginalways require a fresh proof. OIDCmax_ageis checked againstauth_time(primary sign-in) as well as the MFA proof age.
Protocols
SAML 2.0 (built; extended)
- Endpoints:
GET /api/v1/sso/saml/{clientId}/metadata, andGET|POST /api/v1/sso/saml/{clientId}/sso. The issuer and entity ID are derived fromSSO_SAML_ORIGIN, never from Host. - Change: remove the single-client env pin. Each enabled client resolves its own profile, active key and request-signing policy from the database.
- Change: metadata publishes every key in
activeandpendingstates as separateKeyDescriptor use="signing"elements, so an SP that imports metadata trusts the new certificate before it is used. - NameID stays
persistent, carrying the random pairwise subject. Email goes only in theemailattribute. Subjects are never derived from email, because addresses can be reassigned. Before enabling Claude, confirm in the WorkOS flow that a persistent NameID is accepted. If WorkOS requires anemailAddressNameID, enabling it needs a recorded exception. Under that exception, SSO is blocked after any email change until an operator reviews it (the existing rule), and deleted internal addresses are never reassigned. - IdP-initiated (later, per-client opt-in): requires a registered default ACS and
RelayState allowlist, a CSRF-protected POST started by a user action, admin
MFA to enable it, no remembered consent, and a one-time server transaction,
since there is no
InResponseTo. It stays off for Claude.
OpenID Connect provider (new)
- Issuer:
https://tuturuuu.com/api/v1/oidc(decision D4). The issuer must never change once clients exist. - Discovery:
{issuer}/.well-known/openid-configuration. JWKS:{issuer}/jwks, which publishesactiveandpendingkeys. - Flow: authorization code only.
response_type=code, PKCES256is mandatory for every client (including confidential ones), andstateandnonceare required. Implicit, hybrid,plainPKCE,request_uriand dynamic client registration are not supported. - Authorize
GET {issuer}/authorize: the exactredirect_urimatch (byte equal to a registered URI) is checked before any redirect. Errors with an unknown client or redirect render a local error page and never redirect. The same Sorbet consent page and transaction machinery as SAML apply. Every authorization response carriesiss(RFC 9207) to stop mix-up attacks. - Token
POST {issuer}/token:client_secret_basicorprivate_key_jwt. Aprivate_key_jwtassertion must use the pinned algorithm (nevernoneorHS*).issandsubmust both equal theclient_id. Itsaudmust be exactly the issuer or exactly the token endpoint URL, and an array carrying any other value is rejected.expis at most 5 minutes out, andjtiis required and single use per client (cached until expiry). Client secrets are 256-bit random values stored as SHA-256 hashes (high entropy needs no slow hash). Rotation allows two valid secrets during an overlap window. Codes are 256-bit random, stored hashed, single use, valid for 60 seconds and bound to client, redirect URI, PKCE challenge, nonce, account, session, policy revision, granted scopes and claims hash. Access tokens carry the same scopes and claims hash. Reusing a code burns it and revokes every token issued from it. - Tokens: the id_token is RS256-signed, valid 5 minutes, with claims
iss,sub(pairwise per client),aud,azp,exp,iat,auth_time,nonce,acr(urn:tuturuuu:aal2),amr(the methods actually used, such aspwdorotp, never a fixed value; other factors count only once a later decision qualifies them for the MFA rule), and with consentemail,email_verified,given_name,family_name. The access token is opaque, hashed at rest, valid 10 minutes, and grants onlyuserinfo. There are no refresh tokens in the first OIDC release. - UserInfo
GET {issuer}/userinfo: only the claims the token’s scopes granted. It rechecks the account, membership, assignment and token revocation, but not MFA age, which applied at authorization. prompt:loginforces a fresh sign-in plus MFA.consentbypasses a remembered grant.nonereturnslogin_required,interaction_requiredorconsent_requiredinstead of showing any page.- Scopes:
openid(required),email,profile. Unknown scopes are rejected. - OIDC signing keys are never shared with SAML. Each
kidis bound to one client and one protocol. - These OIDC keys, codes and tokens are separate from the external-app bearer and cross-app token systems, and never reuse their signing keys.
Security model
Key custody and rotation
-
Each key has a
kid, a status from the existing schema (pending→active→retiring→revoked) and validity dates. At most one key isactiveper client, enforced by a partial unique index. Eachkidis bound to exactly one client and one protocol. RSA keys are never shared between SAML and OIDC. -
Custody: private keys are Worker secrets named
SSO_SIGNING_KEY_<KID>on a dedicated signer Worker, or non-exportable KMS keys the Worker calls (D3). The Worker is not a raw signing oracle:apps/websends structured input: client, protocol, transaction, subject, the consented attribute values (email,firstName,lastName), audience or ACS,NotOnOrAfterorexp, and nonce orInResponseTo.- The Worker builds the assertion or JWS itself, through the same
packages/ssobuilder and canonicalizer, and signs both the SAMLResponseandAssertion. - It accepts a request only with a finalization permit issued at
sso_finalize_issuance. The permit binds a hash of every structured field plus thekid, lives 60 seconds or less, and is single use. - Permit IDs and request nonces are recorded in a Durable Object (strongly consistent), never in KV or isolate memory, so a replay to another isolate or region is still refused.
- The Worker also confirms the transaction independently, through a
dedicated Worker-only database role that can read only an approved,
consumed, not-yet-signed transaction and its bound fields. A compromised
apps/webholds the HMAC and permit keys, but still cannot mint an assertion for a subject, client or destination with no real consumed transaction. Without that check the Worker would only protect the private key from extraction. - The permit is signed with a dedicated Ed25519 key. The service-only finalization path signs it with a secret held outside Postgres (a server secret, never a database column or setting). The Worker holds only the public key and checks it. That key rotates on the same dual-publish schedule as signing keys.
- It checks the
kid-to-client andkid-to-protocol binding. - Requests are authenticated by an HMAC over the body plus a timestamp and a single-use nonce, never a static bearer.
- It rate-caps issuance and logs a correlation ID only.
issuance.signedis appended only after the Worker returns a signature. A Worker timeout or error appendsissuance.failedand burns the transaction. The existing five-second budget covers finalization, the Worker call and the final MFA recheck together, so the 60-second permit lifetime never extends it. This amends the finalization order in Outbound SSO to Claude once S1c ships.- Deploying it and writing its secrets is restricted to the release authority in Cloudflare.
SamlSignercontract (({xml,id,kind}) => stringinpackages/sso/src/contracts.ts) into an async signer port, and spikes assertion construction inside the Worker. Changingnode-signer.tsalone is not enough. -
Rotation (SAML dual-publish): create a
pendingkey and publish it in metadata alongsideactive. The admin re-imports the metadata or uploads the new certificate in WorkOS. After the SP confirms, promotependingtoactiveand demote the old key toretiring. A retiring key stays in metadata for about one day (enough for in-flight assertions), then becomesrevoked. Claude’s portal accepts one certificate at a time, so rotate only with Require SSO off. Alert 30 days and 7 days before expiry from a Cloudflare cron. Certificate validity is 2 years (D5). -
Rotation (OIDC): publish the
pendingkey in JWKS at least 24 hours before promotion. RPs cache JWKS, so promote in the same staged order. -
Compromise: a stolen key can mint assertions for any email, including
Claude Owners, with any lifetime, until the SP stops trusting it. Turning off
issuance on the Tuturuuu side does not help. The runbook, rehearsed before
the pilot:
- Turn Require SSO off, or confirm the verified Owner bypass works.
- Replace or remove the certificate in WorkOS.
- Set the key to
revokedand disable issuance. - Rotate the key.
- Re-establish trust.
- Availability: monitor the signer Worker and the Redis limiter. Both fail closed, so an outage denies every SSO login. That is acceptable only while Require SSO is off, or while an Owner bypass has been verified (see rollout).
Audit
Each admission, consent, denial, consume, signature, failure, OIDC code exchange and userinfo read appends one event: type, client, policy revision,kid,
correlation and transaction UUIDs, and time. No email, names, tokens, assertions
or IP addresses are stored in audit rows. A security review can map the actor
UUID to an email through access-controlled tables. This is stricter than “email
only” on purpose. New event types (key promotion and revocation, role-derived
grant, remembered-consent use and revocation, SCIM connection changes and
dead-lettered SCIM operations) extend the event_type check list by migration.
Retention (D7) runs from the existing Cron Control Worker through a dedicated
service-only, time-bounded purge function, never by disabling or bypassing the
append-only triggers. Designing that function is part of its slice.
SCIM provisioning (phase 2 of this design)
- Tuturuuu acts as the SCIM client. It pushes users to each SP’s SCIM 2.0 endpoint, for example Claude Enterprise through WorkOS directory sync.
- Triggers: assignment granted or revoked, role change, membership removal, demotion to guest, account deletion, Auth ban or disable, name change and a change of email or email domain. These fire only for users who are assigned to, or already SCIM-linked with, that client, so changes to other workspace members never touch existing SP accounts. Each writes an outbox row in the same transaction. The row holds only IDs (no PII).
- Each linked user has a stored
(client_id, user_id) → scim_remote_idmapping, created from the SP’s response to the first create. Updates and deactivation address that ID only, and never match accounts by email. That way an email change cannot relink another existing account, including a Claude Owner. - A Cloudflare Queue consumer delivers the user’s current state, computed
when the call is sent and ordered by a per-user sequence number, not raw
events. A reordered event therefore cannot re-activate a revoked user.
Operations are idempotent
PUTorPATCH active=falsecalls. - Stop fence: both the
sso_scim_pushflag andsso_scim_connections.enabledare checked before every HTTP call. - Retries are bounded (5, exponential) behind a per-client circuit breaker. After the limit, an operation goes to a dead-letter queue, and an alert fires for any missed deprovision.
- Endpoints must be HTTPS on an allowlisted host. Private and internal addresses
are refused. Requests use
redirect: 'manual', and any 3xx is treated as a failure, so the bearer token is never forwarded to another origin. - Cost bounds follow the Cloudflare billing rules in AGENTS.md: bounded work per invocation, terminal-state scheduling, and operation-count tests.
- Bearer tokens are Worker secrets by name, written only by the release authority. The admin UI shows connection health and never accepts a token.
- Deprovisioning sends
active=false. Hard delete only follows an explicit admin policy. - Team-plan Claude has no SCIM. There, deprovisioning means revoking the assignment (so SSO is denied on the next login), plus removing the user manually in Claude. With Require SSO on, the existing Claude session ends at its own expiry.
User experience
All strings are in EN and VI. The UI uses@tuturuuu/ui Sorbet components only,
with mockups made in Claude Design and Artifacts and reviewed with the
design-system lead before the UI slices.
-
Sign in with Tuturuuu (exists; extended): the app’s name and icon, its
registered domain, the claims list, and Allow/Deny. With D1 “remember”, later
logins skip the prompt and show a short “Signing you in to ”
interstitial. That flow works like this:
- the interstitial does not auto-submit. The user selects Continue, a same-origin, CSRF-protected POST bound to the session, before any assertion or code is released. A cross-site page that starts SP-initiated SSO therefore cannot complete a login silently;
- the server approves the transaction and still writes the per-login disclosure receipt;
- the remembered grant is keyed on actor, client, policy revision and a hash of the claim names and their current values, so a changed email or name asks again;
- users can revoke it;
ForceAuthn, OIDCprompt=consentandprompt=loginbypass it;- it never applies to IdP-initiated logins.
-
My apps launcher (new) at
/{locale}/apps: the tiles the user is assigned to. Each tile goes to the SP’s registered SSO start URL, so the SP initiates. -
Admin applications (exists at
/{wsId}/sso; extended): a protocol picker (SAML or OIDC), templates (Claude, GitHub Enterprise, Slack, Notion) that pre-fill only non-secret defaults, role-based access, a keyring panel with “publish pending key” and “promote”, an OIDC client secret shown once, SCIM connection health, and the audit list.
Feature flags and rollout
Add every flag to
config/feature-flag-catalog.json. The per-client enabled
column is a second independent gate.
Rollout: staging with a local SP and RP first. No separate Claude test
organization exists, so the pilot runs on the production Tuturuuu Claude
organization (Enterprise, with SCIM). That makes these pilot rules binding:
- Require SSO stays off for the entire pilot. SSO is optional. Require SSO can be considered only after at least two Claude admins have signed in through SSO, and email-link login has been confirmed to work as break-glass.
- Break-glass owner. A documented Claude Owner account that is not bound to SSO, signs in by email link, and is never assigned to the Tuturuuu SSO application. Prefer an address on a domain that is not verified for SSO, if Claude allows such an Owner, so that a later Require SSO cannot bind it. Record its existence (not its credentials) in the pilot packet. During S2 setup, confirm and record Claude’s JIT setting (kept off).
- Named pilot users first. Assign only one or two named
@tuturuuu.compilot users. Widen to the rest of the organization only after their logins, denials and revocations behave as specified. SCIM starts in dry-run (compute and audit the operations without sending them), then runs against those pilot users only. - Rotation before expiry risk. Rehearse dual-publish rotation (publish the pending key, update WorkOS, promote, retire) on the live connection while Require SSO is off, long before the first certificate nears expiry.
- Domain verification. The Claude Owner starts verification of
tuturuuu.comin Claude to obtain the exact TXT value. The release authority then adds the record in Cloudflare DNS. The pilot packet records the exact record (nametuturuuu.com, typeTXT, the fullanthropic-domain-verification-…value, and TTL) before it is created.
- confirm in Claude, with recorded evidence, that an Owner can bypass SSO;
- set the runbook order to “turn Require SSO off first, then the kill switch”;
- do every rotation with Require SSO off.
Delivery slices
Each slice gets tests, a cross-family security review and acheck:changed
pass, and lands separately. Migrations need an isolated reset plus a pgTAP
receipt and an exact-SQL ACK.
- S1 Multi-client and keyring (SAML): drop the env client pin, publish
pendingandactivekeys in metadata, add the async signer port, and build the Worker spike. Migration. - S2 Claude pilot: catalog flag, operator runbook, staging acceptance against the local Node-SAML SP, then the real Claude test connection (needs USER actions and an Iris ACK).
- S3 Remembered consent, per-client MFA age and constrained role grants (D1, D2). Migration.
- S4 OIDC provider core: tables, discovery, JWKS, authorize, token and
userinfo, behind
sso_oidc_provider. Migration. - S5 Admin UI for OIDC and keyring, plus the app launcher.
- S6 SCIM push Worker behind
sso_scim_push. Migration. - S7 Per-workspace verified domains for customer IdP use.
Test plan
- Unit (
packages/sso): OIDC request validation (redirect mismatch, missing PKCE,plainPKCE, missing nonce, unknown scope), id_token claims and expiry, multi-key metadata and JWKS, thekidselection state machine, and remote-signer error handling (timeout, wrongkid, malformed signature). - Route (
apps/web): the real handlers with mocked Auth/RPC. They cover ineligible domain, guest, unassigned, role-removed, stale MFA, account switch, replayed code or assertion, disabled client and limiter outage. - pgTAP (
sso-persistence.sqlplus new OIDC/SCIM fixtures): code single-use races, the token revocation cascade, role-grant re-evaluation, outbox atomicity, and append-only audit. - End to end in an isolated environment: the Node-SAML SP harness and an
openid-clientRP harness log in with a seeded MFA user. Add a SCIM mock server for idempotency and stop-fence tests. - Acceptance: the real Claude connection test, Test SSO in WorkOS, denial cases, and a rotation rehearsal on the test connection.
Connecting claude.ai (USER, as Claude organization Owner)
- In Claude, open Organization settings → Organization and access → Add or
edit domains and add
tuturuuu.com. Copy theanthropic-domain-verification-…value into the pilot packet. The release authority creates that TXT record at the apex domain in Cloudflare DNS. Wait for Verified. - In Tuturuuu, open the internal workspace’s Single sign-on page, then Add SSO application → Claude. Leave it disabled for now.
- In Claude, go to Authentication → Setup SSO, choose Custom SAML, and copy the WorkOS ACS URL and SP Entity ID into the Tuturuuu application. Note the WorkOS NameID and attribute requirements.
- Copy the Tuturuuu metadata URL (or the IdP entity ID, SSO URL and public
certificate) into WorkOS. Map
email,firstName,lastNameandid. - In Tuturuuu, assign only the one or two named pilot users. After the release authority approves the exact configuration, enable the application and run Test SSO in WorkOS.
- Keep Require SSO for Claude off and JIT off (members stay invited) for the whole pilot. Confirm the break-glass Owner still signs in by email link. Widen assignments only under the pilot rules above.
- Connect SCIM after S6 ships, in dry-run first. Register the WorkOS directory-sync endpoint host in the Tuturuuu SCIM connection. The release authority stores the WorkOS bearer token as a Worker secret. The token is never pasted into the Tuturuuu UI.
Decisions (2026-11-24)
- D1 Consent: remembered per app, keyed on actor, client, claims hash and policy revision. Users can revoke it in account settings. Every login still writes a disclosure receipt.
- D2 MFA freshness: at most 12 hours from the last factor-bound TOTP proof for ordinary apps, and 10 minutes for high-privilege apps.
- D3 Key custody: an assertion-building Cloudflare signer Worker that holds keys as Worker secrets by name. Non-exportable KMS stays a later hardening option.
- D4 OIDC issuer (default):
https://tuturuuu.com/api/v1/oidc. - D5 Certificate lifetime (default): 2 years, with dual-publish rotation.
- D6 Claude plan: Enterprise, with SCIM through WorkOS directory sync.
- D7 Audit retention (default): 1 year.
- D8 Internal workspace (default): the root workspace owns the internal applications.
tuturuuu.com is still open.