Early-stage SaaS products typically model B2B customers with a flat tenant_id column, assuming every company has one login policy, one IdP, and one set of security rules. That model shatters the moment you sign a conglomerate, healthcare network, or global bank whose trading desk, EU subsidiary, and external audit contractors demand completely different MFA, IdP, and session policies under the same commercial contract.
Key Takeaways
- Real enterprise buyers operate hierarchically—across subsidiaries, regional branches, franchises, and contractor cohorts—rather than as flat workspaces.
- A 4-tier Policy Inheritance Cascade (Tenant, Application, Organization, Organization Unit) prevents configuration duplication by inheriting defaults upward and toggling surgical overrides only where required.
- Scoping IdP connections with assignToOrganizationOnly and assignToOrganizationUnitOnly isolates subsidiary directories cleanly inside a shared SaaS runtime.
- Passing explicit organizationId and organizationUnitId parameters at login embeds deterministic org_id and ou_id claims into signed JWTs for downstream authorization.
Why Flat Tenant Tables Break When Selling Upmarket
In a simple startup schema, each paying company gets one workspace row and one settings JSON blob. That works smoothly for 20-person teams, but breaks down immediately when onboarding enterprise organizations. Consider a global financial institution: corporate headquarters wants unified co-branding and consolidated billing, its New York and London trading desks require hardware FIDO2 YubiKeys with 10-minute access tokens and office IP allowlists, its European subsidiary must satisfy GDPR regional controls, and external seasonal auditors authenticate through a completely separate contractor Okta tenant.
Without native sub-organization modeling, SaaS teams resort to ugly workarounds: spinning up separate isolated tenants for every department (breaking cross-department reporting and unified billing), duplicating branding and password policies across dozens of records, or littering application middleware with fragile customer-specific if-statements. Every policy change from the customer's CISO turns into an error-prone multi-record update.
- Holding companies and M&A-active enterprises frequently run multiple IdPs simultaneously (for example, legacy ADFS in an acquired subsidiary alongside Okta at HQ).
- Regulated departments like finance, clinical care, or institutional trading require stricter MFA step-up and shorter token TTLs than general marketing teams.
- External contractors, franchisees, and managed service provider (MSP) clients need isolated login connections and narrow permissions inside the parent customer's workspace.
- Duplicating baseline settings across sub-tenants causes configuration drift and audit non-compliance whenever global security baselines tighten.
Architecting the Four-Tier Policy Inheritance Cascade
The cleanest architecture for multi-tenant B2B identity is a deterministic 4-tier Policy Inheritance Cascade: Tier 1 is the SaaS platform Tenant baseline, Tier 2 is the Application layer (web SPA, mobile app, admin portal), Tier 3 is the B2B Customer Organization, and Tier 4 is the Organization Unit (department, subsidiary, or regional division). Every child tier automatically inherits 100% of its parent's configuration unless an explicit domain override flag is switched on.
Grouping overrides into five orthogonal domains—overrideGeneral, overrideBranding, overrideSecurity, overrideTokens, and overrideMfa—gives architects surgical precision. A customer's Institutional Trading Desk OU can flip overrideMfa and overrideTokens to mandate FIDO2 hardware keys plus TOTP step-up and 10-minute tokens, while leaving overrideBranding false so it automatically inherits the parent Organization's logo and colors. If the customer rebrands next quarter, updating branding once at Tier 3 propagates instantaneously across all 30 child OUs.
- Tier 1 (Tenant): establishes global SaaS defaults for password minimums, threat defense, base theme, and default signing algorithms.
- Tier 2 (Application): tunes client-specific behaviors such as mobile refresh token lifetimes or PKCE enforcement.
- Tier 3 (Organization): isolates each B2B customer's co-branding, verified domains, dedicated IdP connections, and baseline contractual security rules.
- Tier 4 (Organization Unit): applies department or regional exceptions (strict FIDO2 MFA, office IP geofencing, contractor IdPs) without copying parent policies.
{
"resolvedPolicyContext": {
"tier1Tenant": "cloudpulse-prod",
"tier2Application": "cloudpulse-web-spa",
"tier3Organization": {
"id": "6c4a8f12-9b30-4e11-8d2a-112233445566",
"name": "GlobalBank Corp",
"overrideBranding": true,
"overrideMfa": true,
"overrideSecurity": false
},
"tier4OrganizationUnit": {
"id": "9d8e7f6a-5b4c-3d2e-1f0a-998877665544",
"name": "Institutional Trading Desk",
"overrideBranding": false,
"overrideMfa": true,
"overrideSecurity": true,
"overrideTokens": true
}
},
"effectiveRuntimePolicy": {
"brandingSource": "tier3Organization",
"mfaSource": "tier4OrganizationUnit",
"requireMultipleFactors": true,
"allowedMfaFactors": ["fido2_passkey", "totp"],
"ipAllowlistCidr": ["198.51.100.0/24", "203.0.113.0/25"],
"accessTokenLifetimeMinutes": 10,
"refreshTokenRotation": true
}
}
Scoping Identity Connections and Passing Runtime Context
Policy inheritance must extend to federation discovery so enterprise directories never bleed across tenant boundaries. By tagging a SAML or OIDC connection with assignToOrganizationOnly or assignToOrganizationUnitOnly, the identity provider stays completely invisible on your public login screen and surfaces strictly when authentication targets that exact customer Organization or sub-department.
At runtime, your application initiates login by passing organizationId—and optionally organizationUnitId—to the OIDC authorization endpoint alongside standard PKCE parameters. Once authentication succeeds, the identity server evaluates the 4-tier cascade, verifies the user's membership and roles inside that exact Organization and OU, and stamps immutable org_id, ou_id, and scoped role claims directly into the signed JWT. Downstream APIs never guess which division a user belongs to.
- Isolate corporate IdPs using assignToOrganizationOnly for company-wide SSO and assignToOrganizationUnitOnly for contractor or subsidiary directories.
- Resolve organizationId and organizationUnitId via subdomain routing, verified email domain HRD, or explicit workspace switchers.
- Support multi-organization users (such as auditors, MSP engineers, or agency consultants) cleanly by issuing fresh org-scoped tokens when switching active contexts.
- Bind application role assignments to the (userId, organizationId, organizationUnitId) tuple so an Admin in Subsidiary A holds read-only access in Subsidiary B.
GET /oauth/authorize?
client_id=vvzmXqvkLfnMDtUJPChKn&
response_type=code&
redirect_uri=https%3A%2F%2Fapp.cloudpulse.io%2Fcallback&
scope=openid%20profile%20email%20roles&
organizationId=6c4a8f12-9b30-4e11-8d2a-112233445566&
organizationUnitId=9d8e7f6a-5b4c-3d2e-1f0a-998877665544&
code_challenge=E9Melhoa2OwvFrGMTJguCHaoeK1t8URWbuGJSstw-cM&
code_challenge_method=S256&
state=st_8a7f12c9e0b4 HTTP/1.1
Host: auth.sso.id
// Decoded RS256 Access Token Claims After Cascade Evaluation:
// {
// "iss": "https://auth.sso.id",
// "sub": "usr_4410b9e2-2c11-48a3-a201-55f9100e42ab",
// "aud": "vvzmXqvkLfnMDtUJPChKn",
// "org_id": "6c4a8f12-9b30-4e11-8d2a-112233445566",
// "ou_id": "9d8e7f6a-5b4c-3d2e-1f0a-998877665544",
// "roles": ["Trading Desk Operator"],
// "amr": ["hwk", "otp", "mfa"]
// }
Delegated Administration and Clean Context Switching
As B2B accounts grow into thousands of seats across dozens of Organization Units, your internal support team should never be the bottleneck for department onboarding. Modeling Organizations and OUs as first-class API resources enables delegated customer administration: a regional IT lead for the EU Division can manage EU users, assign OU-scoped roles, and inspect EU login activity without gaining read or write permissions over the North America division.
For users who legitimately belong to multiple Organizations or OUs—common in accounting firms, healthcare groups, and SaaS agencies—enforce explicit context switching rather than cramming every organization's permissions into a single bloated JWT. When a user switches workspaces in the UI, execute a silent OIDC re-authorization with the target organizationId and organizationUnitId so the cascade re-evaluates MFA step-up requirements (for instance, prompting for a FIDO2 hardware key when entering a high-security OU) before minting the new token.
- Never embed all cross-organization roles into one mega-token; mint strictly single-context tokens bound to the active org_id and ou_id.
- Re-evaluate Tier-3 and Tier-4 MFA, IP geofencing, and session-timeout rules automatically on every workspace context switch.
- Expose REST APIs for creating OUs, linking groups, and assigning roles so enterprise customers can automate department setup via Terraform or internal IT portals.
- Audit every policy override toggle with actor, timestamp, and before/after values to simplify enterprise compliance reviews.
Treat workspace switching as a fresh authorization boundary, not a cosmetic UI filter. Re-running the OIDC authorize flow with the target organizationUnitId guarantees that entering a high-assurance division triggers any required FIDO2 step-up MFA or IP allowlist check.
How SSO.ID Models Enterprise B2B Hierarchies Natively
SSO.ID v2 implements the complete 4-tier Policy Inheritance Cascade out of the box across Tenants, Applications, B2B Organizations, and Tier-4 Organization Units, complete with REST management APIs and runtime JWT claim injection.
- ✓First-class Organizations (/organizations) and Organization Units (/organization-units) with five granular override toggles: General, Branding, Security, Tokens, and MFA.
- ✓Exclusive connection scoping via assignToOrganizationOnly and assignToOrganizationUnitOnly to isolate subsidiary, partner, and contractor IdPs.
- ✓Runtime organizationId and organizationUnitId authorization routing that evaluates inherited policies and injects verified org_id and ou_id claims into signed RS256 tokens.
- ✓Full REST API surface (/api/organizations and /api/organization-units) for programmatic provisioning of groups, MFA factors, users, and scoped application roles.
Frequently Asked Questions
Create a separate Organization for each distinct commercial customer or legal tenant boundary. Use Organization Units underneath that Organization for departments, regional branches, subsidiaries, franchises, or external contractor groups that belong to the same enterprise customer.
Yes. Any Organization Unit with overrideBranding set to false automatically inherits live branding updates from its parent Organization, while OUs that explicitly enable overrideBranding keep their customized regional or sub-brand look.
Yes. Users can be assigned to multiple Organizations and OUs with distinct application roles in each. At login or context switch, the issued token reflects only the active Organization and Organization Unit's effective policies and roles.