Join our Newsletter — 33% off our NHI Course
Home› Guides› B2B CIAM and Organisation Management Guide: Tenants, Per-Customer…
Guide Customer Identity

B2B CIAM and Organisation Management Guide: Tenants, Per-Customer SSO and Delegated Admin

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

When a SaaS product sells to businesses, each customer organisation expects to bring its own identity provider, manage its own users and never see another customer's data, and most consumer-style CIAM designs are not built for that. B2B CIAM adds an organisation layer between the platform and the user: organisations own email domains, enterprise SSO connections, provisioning feeds, roles and administrators. Mistakes in that layer cause cross-tenant access, account takeover through unverified domains and orphaned accounts when a customer's employee leaves. This guide covers the organisation data model, domain verification and routing, per-tenant SSO and SCIM, token claims and tenant isolation, delegated administration and the lifecycle controls that matter. It is for architects and engineers building or buying identity for B2B SaaS.

Key takeaways

  • Model the organisation explicitly. Users, domains, connections, roles and admins belong to an organisation object, and one person can belong to several organisations. Do not infer tenancy from email domain alone.
  • Verify domains before trusting them. A customer should prove control of a domain (typically with a DNS TXT record) before it can route sign-ins, auto-join users or enforce SSO for that domain.
  • Key users by issuer plus subject, not email. OWASP ASVS 5.0 V6.8.1 and V10.5.2 require identities to be namespaced by identity provider so one customer's IdP cannot assert another customer's users.
  • Every token and every query carries the tenant. APIs must validate the organisation claim against a known value and filter data by it (ASVS V8.4.1). Missing tenant checks are the root of most cross-tenant leaks.
  • Delegated admin is a privileged channel. Customer admins who can change SSO, SCIM and roles hold the keys to that tenant; protect, log and limit them like your own administrators.

How B2B CIAM differs from consumer CIAM and workforce IAM

AspectConsumer CIAMB2B CIAMWorkforce IAM
Who owns the userThe individualThe customer organisation (often through its own IdP)The employer
Sign-inPasswords, passkeys, social loginPer-organisation SAML or OIDC SSO, plus local accounts for small customersCorporate IdP
ProvisioningSelf-registrationInvitations, just-in-time from SSO, SCIM from the customerHR-driven
AdministrationSupport teamCustomer admins (delegated) plus vendor supportInternal IT
Isolation requirementPer userPer organisation and per userSingle organisation
Leaver handlingUser closes accountCustomer IdP disables user; SCIM or session expiry must followHR leaver event

For consumer patterns see the Customer IAM (CIAM) Guide. For the data-plane side of tenant isolation see the Multi-Tenant SaaS Authorisation and Tenant Isolation Guide.

The organisation data model

  • Organisation: a stable internal ID, display name, plan and settings. Auth0 Organizations, for example, describes each organisation as usually mapping to one business customer or partner, with users able to belong to more than one.
  • Membership: a user-to-organisation link carrying roles for that organisation. Keep roles scoped to the membership, not global to the user, so a consultant who is an admin in one customer is a viewer in another.
  • Domains: zero or more verified domains per organisation. Keycloak, for instance, forbids the same domain from belonging to two organisations in one realm and supports exact and wildcard domains with the most specific match winning.
  • Connections: the identity sources enabled for the organisation: a shared database or passkey connection, social login, or the customer's enterprise SAML or OIDC IdP.
  • Managed versus unmanaged members: Keycloak distinguishes members whose accounts exist only through the organisation (managed, removed with it) from accounts that exist independently and were added. Decide which applies, because it controls what happens when membership or the IdP link is removed.
  • Application access: whether members can use every application by default or only those explicitly granted. Auth0 calls these the implicit and explicit models.

Domain verification and sign-in routing

Home realm discovery, routing a user to their organisation's IdP from the email domain they type, is convenient and dangerous. If any tenant can claim any domain, an attacker can register a trial organisation, claim a victim company's domain and capture its users' sign-ins or auto-join them.

  1. Require proof of control: issue a random token and ask the customer to publish it as a DNS TXT record, as in the WorkOS domain verification flow, and only mark the domain verified when you observe it. Re-check periodically and on change of plan or ownership.
  2. Gate features on verification: only verified domains may enable SSO enforcement, automatic routing, auto-join of new users or the restriction of email domains for members.
  3. Refuse public mail domains: block consumer webmail domains and public suffixes from being claimed. Keycloak, for example, rejects wildcards over bare top-level domains.
  4. Handle users with existing credentials: Keycloak does not auto-redirect a user who already has first-factor credentials such as a password; they authenticate with those. Decide your own rule for migrating such users to SSO and communicate it.
  5. Do not trust the IdP's email blindly: require a verified email before domain-based membership. Keycloak's documentation notes that an OIDC provider returning email_verified=false does not establish a verified address even when Trust Email is enabled.

Per-tenant SSO and provisioning

MechanismWhat the customer getsSecurity requirement
SAML 2.0 connection per organisationSSO from their IdPPer-tenant entity ID and certificate; signed assertions; audience and recipient checks; reject IdP-initiated flows unless needed. See the SAML Security Guide.
OIDC connection per organisationSSO with modern IdPsValidate issuer and audience; key accounts on iss plus sub; check acr or amr if you need MFA (ASVS V6.8.4)
Just-in-time provisioningAccounts created at first SSOOnly for verified domains and enabled connections; assign least-privilege default role
SCIM 2.0 (RFC 7643, RFC 7644)Automated create, update and deactivateSeparate SCIM credential per organisation, scoped to that tenant's base path; rotate; log calls. See the SCIM Provisioning Guide.
InvitationsAdmin invites named usersSingle-use, expiring links; invitee must sign in with the invited address (Auth0 enforces this, including for federated sign-in)
Local accounts for small customersNo IdP neededPasskeys or MFA; disable local sign-in once a customer enforces SSO, except for documented break-glass admins

The cross-IdP spoofing problem: if the application looks users up by email address, a customer who controls their own IdP can assert any email, including one belonging to a user in a different organisation. OWASP ASVS 5.0 V6.8.1 requires that a user's identity cannot be spoofed through another supported IdP, with the standard mitigation being to register users by IdP identifier plus user ID, and V10.5.2 requires the client to identify users by a claim, usually sub, that cannot be reassigned. Store the tuple (connection, issuer, subject), and treat email as a mutable attribute.

Tokens, claims and tenant isolation

  • Carry the organisation: put the organisation ID in ID and access tokens. Auth0 includes org_id by default; Keycloak maps membership through the organization scope (which can request one organisation, a named alias, or all memberships) and the Organization Membership mapper.
  • Validate it: Auth0's guidance is that if an org_id cannot be validated against a known value, the application or API should deem the token invalid, and that APIs must segment access to data and resources by it. Prefer IDs over names, which can change.
  • Match the context: check the organisation in the token against the organisation implied by the request (subdomain, path or header). A valid token for organisation A used against organisation B's URL must fail.
  • Enforce in the data layer: apply the tenant filter in a shared repository layer, or with database row-level security, rather than in each endpoint. ASVS V8.4.1 asks for cross-tenant controls so operations never affect tenants the consumer is not permitted to touch.
  • One active organisation per session: users who belong to several organisations should switch explicitly, and the token should be reissued for the new organisation rather than carrying all memberships into every request.
  • Machine clients too: customer API clients and integrations need organisation-scoped client credentials. See the Machine-to-Machine OAuth (Client Credentials) Guide.

Delegated administration

Customers expect a self-service admin console: invite users, assign roles, configure SSO and SCIM, view audit logs. Those powers are equivalent to tenant ownership.

Admin capabilityRisk if abusedControl
Change SSO connection or certificateAttacker redirects all sign-ins to an IdP they control (T1484.002 Trust Modification)Step-up authentication, notification to all tenant admins, optional delay, full audit
Issue or rotate SCIM tokenMass account creation or deactivationShow the token once; store hashed; restrict to admin role; alert on use from new networks
Assign admin rolePersistence through extra admins (T1098 Account Manipulation)Minimum two admins, maximum set by plan, alert on new admin
Disable SSO enforcementFallback to weaker local sign-inStep-up and notification; keep break-glass accounts few and named
Export users or audit logsData exfiltrationRate limits and logging

Vendor support access: your own staff impersonating or administering a customer tenant is a T1199 Trusted Relationship path. Require customer-visible, time-boxed, approved access with a reason and log entry, and never let support change SSO or add admins without the customer's consent.

Build admin consoles on the platform's management API from a confidential back end only; Auth0's documentation makes this point for its Management API, and the principle applies to any CIAM platform.

Lifecycle: joiners, leavers and organisation offboarding

  • Leavers at the customer: when the customer's IdP disables a user, SSO stops new sign-ins but existing sessions, refresh tokens and API keys in your product survive. Accept SCIM deactivation, shorten session and refresh lifetimes for SSO users, and support back-channel logout or Shared Signals events where you can. See the Shared Signals Framework Guide.
  • Personal tokens: revoke API tokens a user created when their membership ends; SCIM deactivation does not do this unless you wire it.
  • Movers between organisations: a consultant leaving one customer keeps their memberships elsewhere; remove only the affected membership.
  • Organisation offboarding: on contract end, disable connections, revoke SCIM and API credentials, end sessions, then delete or retain data according to contract and privacy obligations.
  • Domain transfer: when a company is acquired or a domain changes hands, re-verify and move domains deliberately rather than letting two organisations claim the same users.

Choosing an approach

SituationApproach
Early-stage SaaS, mostly small customersShared login with organisation membership, passkeys or MFA, invitations; add SSO per organisation when the first enterprise asks
Mid-market with many SSO customersCIAM platform with native organisation support, self-service SSO and SCIM setup gated on domain verification
Large enterprise customers with strict isolation demandsOrganisation model plus dedicated signing keys or even a dedicated CIAM tenant per customer; note that some platforms (Auth0 among them) do not support per-organisation custom domains, so separate domains require separate tenants
Partners and resellers administering their customersHierarchical organisations or explicit cross-organisation roles with audit, never shared admin accounts
Workforce collaboration between two Microsoft tenantsNot a CIAM problem; see the Entra ID Cross-Tenant Access and B2B Guest Governance Guide

How to implement

  1. Define the model: organisation, membership, roles, domains, connections, and managed or unmanaged accounts. Write down which identifier is canonical (connection plus issuer plus subject).
  2. Add domain verification: DNS TXT verification, public domain block list, periodic re-check.
  3. Thread the tenant through: organisation ID in tokens, validation middleware in every API, tenant filter in the data layer, and automated tests that try cross-tenant access for every endpoint.
  4. Self-service SSO and SCIM: enable for verified organisations, with per-tenant credentials and test-connection steps before enforcement.
  5. Delegated admin with guard rails: step-up for sensitive changes, notifications, audit log visible to the customer.
  6. Pilot with friendly customers: migrate two or three organisations to SSO enforcement, keep a break-glass local admin, and measure sign-in failures.
  7. Rollback: allow a tenant admin, or your support team with recorded customer approval, to switch enforcement off temporarily while keeping SSO configured.

Detection and measurement

  • Log per tenant: sign-ins by connection, SSO and SCIM configuration changes, admin role grants, domain verification events, support access sessions and cross-tenant authorisation failures.
  • Alert on: a new SSO certificate or IdP URL followed by a spike in new accounts; claims of high-profile or already-claimed domains; tokens with an organisation ID that does not match the request context; SCIM calls from new networks.
MetricHealthy signal
Share of SSO-capable organisations with a verified domain100%
Cross-tenant test coverage of API endpointsEvery endpoint covered in CI
Cross-tenant authorisation failures in productionRare, each investigated
SCIM-enabled organisations among SSO organisationsRising
Median time from customer IdP disable to session endMinutes, not days
Support access sessions without a recorded approvalZero

Framework mapping

FrameworkReferenceRelevance
OWASP ASVS 5.0V6.8.1, V6.8.4, V7.1.3, V8.4.1, V10.5.2IdP namespacing, authentication strength from the IdP, federated session coordination, cross-tenant controls, stable subject
NIST SP 800-53 Rev. 5AC-2, AC-3, AC-6, IA-4, IA-8, PS-4, SA-9Accounts, enforcement, least privilege, identifiers, non-organisational users, termination, external services
NIST CSF 2.0PR.AA-01, PR.AA-05, GV.SC-07Identity management, least privilege, third-party relationships
ISO/IEC 27001:2022 Annex AA.5.15 Access control, A.5.16 Identity management, A.5.18 Access rightsPolicy and lifecycle for customer identities
MITRE ATT&CK v20T1199, T1484.002, T1098, T1078.004, T1136.003Trusted relationship abuse, trust modification, admin persistence, cloud account misuse and creation

Common failure patterns

  • Unverified domain claims: any trial tenant can claim a domain and capture routing or auto-join for that company's users.
  • Email as the primary key: a customer IdP asserts another tenant's user's email and is signed in as them, the failure ASVS V6.8.1 exists to prevent.
  • Tenant from the URL only: the API trusts the subdomain and ignores the organisation in the token, or the reverse, so a token for one tenant reads another.
  • Global roles: admin in one organisation becomes admin everywhere because roles are stored on the user, not the membership.
  • SSO without deprovisioning: customer leavers keep refresh tokens and API keys for months because SCIM was never enabled.
  • Silent SSO changes: a compromised customer admin swaps the IdP certificate and nobody else in the tenant is told. Compare the federation trust abuse patterns in the Golden SAML and Federation Trust Abuse Defence Guide.

Practitioner checklist

  • Model organisation, membership-scoped roles, domains and connections explicitly.
  • Verify domains by DNS before enabling routing, auto-join or SSO enforcement; block public mail domains.
  • Store users by connection, issuer and subject; treat email as an attribute.
  • Put the organisation ID in tokens and reject tokens whose organisation is unknown or does not match the request.
  • Enforce the tenant filter in a shared data layer and test cross-tenant access for every endpoint in CI.
  • Issue a separate, rotatable SCIM credential per organisation.
  • Require step-up, notification and audit for SSO, SCIM and admin role changes.
  • Make vendor support access approved, time-boxed and visible to the customer.
  • Revoke sessions, refresh tokens and personal API tokens on SCIM deactivation and membership removal.

Standards and references

Related NHI Mgmt Group resources: Customer IAM (CIAM) Guide · Multi-Tenant SaaS Architecture Security Guide · SCIM Provisioning Guide · CIAM Buyer's Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.