Home / Insights / Architecture and Modernization
Architecture and Modernization
Single Sign-On for Enterprise Apps: Choosing Between SAML and OIDC, and Getting SCIM Provisioning Right
Enterprise customers increasingly expect to sign in with their own identity provider and to have accounts created and removed automatically. This guide explains SAML, OpenID Connect and SCIM in practical terms, how to design them into a multi-tenant product, and the security and rollout details that cause most problems.
TopicsArchitecture and ModernizationWeb and SaaS Development
Key takeaways
- SSO answers who the user is; provisioning answers whether they should have an account at all. Enterprise buyers usually want both, and SCIM is the standard way to deliver the second.
- Support OIDC for new integrations and modern identity providers, and SAML because many enterprises still standardise on it. Put both behind one internal identity abstraction so the rest of the app does not care which protocol was used.
- Most SSO incidents come from validation gaps: unchecked audience or issuer, missing replay protection, weak account-linking rules or trusting email addresses as identifiers.
- In a multi-tenant product, identity configuration is per tenant: each customer brings its own IdP, domains, attribute mappings and role rules. Design the data model for that from the start.
- Roll out per customer with a test tenant, a break-glass admin account, clear deprovisioning behaviour and logs your customer’s security team can review.
On this page
- What SAML, OIDC and SCIM each do
- Choosing what to support, and in what order
- Designing identity into a multi-tenant product
- Getting SCIM provisioning right
- Security checks that prevent most SSO incidents
- Rolling out SSO to customers step by step
- Costs, risks and an enterprise identity checklist
- Frequently asked questions
- Sources and methodology
Sooner or later, every business application that sells to larger organisations meets the same procurement question: do you support single sign-on? The follow-ups come quickly. Which protocols? Can accounts be provisioned automatically from our directory? What happens when someone leaves? Can we enforce our own multi-factor authentication? For internal enterprise systems the questions are similar, because IT teams want one place to control access.
This article is for CTOs, architects and product owners adding enterprise identity to a SaaS product or an internal platform. It explains what SAML, OpenID Connect (OIDC) and SCIM each do, how to choose and combine them, how to model identity in a multi-tenant system, which security checks matter most, and how to roll SSO out to customers without locking anyone out. Identity integration is a standard part of our enterprise software development work, alongside role-based access, audit logs and integration with systems such as Microsoft 365, SAP and Salesforce.
What SAML, OIDC and SCIM each do
The three standards are often mentioned together, but they solve different problems.
SAML 2.0: federated sign-in with XML assertions
SAML (Security Assertion Markup Language) has been an OASIS standard since 2005. The OASIS SAML 2.0 technical overview describes an identity provider (IdP) that authenticates the user and issues signed assertions, and a service provider (SP), your application, that trusts those assertions. Messages travel through the browser using bindings such as HTTP Redirect and HTTP POST, and partners exchange configuration (endpoints and signing keys) through metadata. Sign-in can start at your app (SP-initiated) or from the user’s IdP portal (IdP-initiated).
OpenID Connect: an identity layer on OAuth 2.0
OpenID Connect Core 1.0 adds identity to OAuth 2.0. Your application (the relying party) redirects the user to the OpenID Provider, receives an authorisation code, exchanges it for tokens, and validates an ID Token: a signed JSON Web Token containing the issuer, a stable subject identifier, the audience, expiry and issue time, and a nonce that ties the token to the original request. OIDC uses JSON and REST conventions that modern web and mobile developers already know, and it supports native and single-page apps more naturally than SAML.
SCIM 2.0: provisioning and deprovisioning
Neither SAML nor OIDC tells your application when a user joins, changes role or leaves. That is the job of SCIM (System for Cross-domain Identity Management). RFC 7644 defines an HTTP protocol in which the customer’s identity system calls endpoints on your application, such as /Users and /Groups, to create, update, patch and delete accounts and group memberships, with discovery endpoints that describe what your implementation supports. It relies on TLS and standard HTTP authentication, typically bearer tokens.
| Question | SAML 2.0 | OIDC | SCIM 2.0 |
|---|---|---|---|
| Main job | Sign-in (authentication) | Sign-in, plus delegated API access via OAuth | Account lifecycle (provisioning) |
| Format | XML assertions, signed | JSON Web Tokens | JSON over REST |
| Who calls whom | Browser carries messages between IdP and app | Browser redirect, then app calls provider’s token endpoint | Customer’s identity system calls your API |
| Best fit | Enterprises standardised on SAML; legacy portals | New integrations, mobile and SPA clients, modern IdPs | Any customer wanting automatic joiner, mover and leaver handling |
| Common pain points | XML signature handling, certificate rotation, clock skew | Token validation details, key rotation, redirect URI handling | Attribute mapping, group semantics, soft versus hard delete |
Choosing what to support, and in what order
For a product selling to enterprises, the practical answer is usually “both sign-in protocols, plus SCIM”, but the order matters when budget is limited.
A decision guide
| Your situation | Start with | Add next |
|---|---|---|
| Internal enterprise app for one organisation | The protocol your IdP team prefers (often OIDC for new apps) | SCIM or directory sync if user volumes and churn justify it |
| SaaS selling to mid-market customers | OIDC with major IdPs, plus SAML for customers who require it | SCIM when deals start asking for automated deprovisioning |
| SaaS selling to large enterprises or regulated sectors | SAML and OIDC | SCIM early; it often appears in security questionnaires |
| Consumer-facing app with business accounts | Social and email sign-in for consumers; OIDC/SAML for business tenants | SCIM only for business tier |
| Product with mobile apps | OIDC with authorisation code and PKCE for native clients | SAML via a broker if enterprise customers require it |
Build, buy or broker
You can implement the protocols with mature open-source libraries, use your cloud provider’s identity service, or use a dedicated identity broker that handles per-customer SAML and OIDC connections and exposes one interface to your app. The trade-off is control and cost against speed and maintenance:
- Libraries in your own code: most control and no per-connection fees, but your team owns protocol edge cases, certificate rotation and security updates.
- Cloud identity service or broker: faster per-customer onboarding, admin portals for customers to self-configure, and fewer protocol details in your code; recurring fees and a dependency to manage.
Whichever route you choose, keep your application talking to one internal identity interface: a verified user identity, the tenant it belongs to and a set of attributes. Protocol details should stay at the edge.
Designing identity into a multi-tenant product
In a single-organisation internal system, there is one IdP. In a SaaS product, every customer may bring its own, and identity configuration becomes per-tenant data. Getting this model right early avoids painful migrations later. Our guide to planning a SaaS product around tenancy, billing and operations covers the wider tenancy decisions; identity needs its own attention.
Core entities
- Tenant: the customer organisation.
- Identity connection: a SAML or OIDC configuration belonging to a tenant, with issuer, endpoints, certificates or keys, and status (testing, active, disabled).
- Verified domains: email domains the tenant has proven it controls, used to route users to the right connection.
- User and external identity: your internal user record, linked to one or more external identities keyed by issuer and subject (not by email).
- Attribute and role mappings: rules that turn IdP attributes or groups into your roles and permissions.
- SCIM credentials: per-tenant tokens with their own rotation and revocation.
Routing users to the right IdP
Common patterns are a tenant-specific sign-in URL, a “sign in with SSO” step that asks for an email address and routes by verified domain, and IdP-initiated links from the customer’s portal. Only route by domain once the tenant has verified it; otherwise one customer could claim another’s users.
Roles and groups
Decide who is the source of truth for roles. Some customers want to manage roles entirely through IdP groups; others prefer to manage roles inside your app and only use SSO for sign-in. Support both by making group-to-role mapping optional per tenant, and document what happens when a user’s groups change.
Enforcing SSO
Once SSO is active, many customers want password sign-in disabled for their users. Make this a tenant setting, keep a small number of break-glass administrator accounts with strong multi-factor authentication, and log every use of them.
Getting SCIM provisioning right
SSO creates accounts just in time when users first sign in, but it cannot remove access when someone leaves; a departed employee simply stops signing in, while their account, API tokens and data access remain. SCIM closes that gap, which is why security teams care about it.
Implementation decisions
- Scope: start with
/Users(create, update, deactivate) and add/Groupswhen customers need group-based roles. Advertise what you support through the/ServiceProviderConfig,/Schemasand/ResourceTypesdiscovery endpoints so IdPs can adapt. - Identifiers: store the customer’s external identifier and your own ID separately. Never rely on email as the only key; people change names and addresses.
- Deactivate before delete: treat an
active: falseupdate or a DELETE as immediate loss of access, revoke sessions and tokens, and apply your data retention policy for actual deletion. Document this for customers. - PATCH semantics: RFC 7644 defines PATCH with add, remove and replace operations applied atomically. Identity providers use PATCH heavily for group membership changes, so test it carefully.
- Filtering: IdPs typically look up existing users with filters such as
userName eqbefore creating them. Support the filters they use, or you will create duplicates. - Authentication and isolation: issue a separate bearer token per tenant, scope every SCIM request to that tenant, and rate-limit the endpoints.
- Reconciliation: provide an admin view or report of SCIM activity and errors, and a way to reconcile accounts created before SCIM was enabled.
The latest revision of NIST’s federation guidance, SP 800-63C Revision 4, reflects the same principles for provisioning APIs: minimise the attributes shared, limit accounts to those covered by the trust agreement, and de-provision relying-party accounts when the subscriber account is terminated, subject to retention rules.
For illustration, consider a 300-person professional services firm adopting a project management SaaS product. Without SCIM, an IT administrator must remember to remove leavers from every application. With SCIM and group mapping, removing a person from the directory deactivates their account in the product within the IdP’s sync cycle, and moving them between teams updates their role automatically.
Security checks that prevent most SSO incidents
Federated sign-in moves trust to the identity provider, but your application still has to validate what it receives. Most real-world SSO vulnerabilities come from skipping a check.
For OIDC
The OpenID Connect specification sets out ID Token validation in detail. At minimum, confirm the issuer matches the expected provider for that tenant, the audience includes your client ID, the signature verifies with the provider’s current keys and an expected algorithm, the token has not expired, and the nonce matches the one you sent. Use the authorisation code flow, with PKCE for public clients, and register exact redirect URIs.
For SAML
- Verify the signature on the assertion or response using the certificate configured for that tenant’s connection, and reject unsigned assertions.
- Check the audience restriction, destination and recipient match your SP entity and endpoint.
- Enforce validity windows with a small allowance for clock skew.
- Prevent replay by recording assertion IDs until they expire.
- Use a maintained library; hand-written XML signature validation is a common source of serious flaws.
For both
- Bind identities to issuer and subject, not email. Linking an SSO identity to an existing account by email alone lets a misconfigured or malicious IdP take over accounts.
- Scope connections to tenants: an assertion from tenant A’s IdP must never grant access to tenant B.
- Single-use and audience-restricted assertions: NIST SP 800-63C requires relying parties to confirm they are an intended audience and to prevent an assertion being accepted more than once.
- Session lifetime: decide how long your session lasts after SSO and whether you re-check with the IdP; enterprise customers often have opinions.
- Logging: record sign-ins, failures, connection changes and SCIM operations with tenant context, and make them available to customer administrators.
- Testing: include identity flows in security testing; our article on layering security testing into CI explains how to keep this continuous.
Rolling out SSO to customers step by step
The technical integration is only half of the work. Each customer connection is a small project involving their IT team, and a bad rollout can lock out an entire organisation.
- Collect requirements: protocol, IdP product, verified domains, required attributes, group-to-role rules, MFA expectations and whether password sign-in should be disabled.
- Exchange configuration: share your SP metadata or redirect URIs; receive their metadata, issuer and keys. Self-service setup screens reduce back-and-forth.
- Test in isolation: configure the connection in a testing state, sign in with test users from the customer, and verify attributes and roles.
- Enable SCIM in dry-run where possible: review what would be created, updated or deactivated before applying it, especially when existing accounts must be matched.
- Activate for a pilot group, then for all users, with break-glass admin accounts confirmed.
- Enforce SSO only after successful sign-ins are confirmed, and communicate the change to users.
- Hand over: give the customer documentation, a contact for identity issues and access to sign-in and provisioning logs.
- Plan certificate and key rotation: track SAML certificate expiry dates and support overlapping certificates so rotation does not cause outages.
This per-customer discipline is similar to the integration onboarding we describe in building a SaaS integrations marketplace: treat each connection as configuration with its own lifecycle, status and support process.
Costs, risks and an enterprise identity checklist
Where the effort goes
- Initial build: identity abstraction, tenant connection model, protocol handling, SCIM endpoints, admin screens and tests.
- Per-customer onboarding: configuration, testing and support time, reduced substantially by self-service setup.
- Ongoing operations: certificate and key rotation, library updates, IdP behaviour changes and support tickets.
- Third-party fees if you use a broker or managed identity service, often priced per connection or per active user.
Key risks
| Risk | Consequence | Mitigation |
|---|---|---|
| Account linking by email | Account takeover across tenants | Link by issuer and subject; verify domains |
| Missing deprovisioning | Former staff retain access | SCIM deactivation with session and token revocation |
| Expired SAML certificate | Whole customer locked out | Expiry monitoring, overlapping certificates, break-glass accounts |
| Group mapping errors | Users receive too much or too little access | Dry-run previews, audit logs, least-privilege defaults |
| Protocol logic spread through the codebase | Hard to maintain and audit | One identity abstraction at the edge |
Checklist
- Internal identity model keyed by issuer and subject, scoped to tenants
- OIDC with authorisation code flow and full ID Token validation
- SAML via a maintained library with signature, audience, validity and replay checks
- Verified domains before domain-based routing
- SCIM
/Userswith filtering, PATCH and deactivation;/Groupswhen needed - Per-tenant SCIM tokens, rate limits and activity logs
- Tenant settings for SSO enforcement and group-to-role mapping
- Break-glass admin accounts with MFA and audit logging
- Certificate and key expiry monitoring
- Customer-facing setup guide and sign-in/provisioning logs
Frequently asked questions
Do we need both SAML and OIDC?
If you sell to a range of enterprises, usually yes. Many organisations still standardise on SAML for workforce applications, while OIDC suits new integrations and mobile or single-page clients. Supporting both behind one internal identity interface keeps the extra cost manageable.
Is SSO enough without SCIM?
SSO controls sign-in but does not remove access when someone leaves, and it cannot pre-create accounts or update roles in advance. Customers with security questionnaires or high staff turnover often require automated deprovisioning, which is what SCIM provides.
Can we use email addresses to match SSO users to existing accounts?
Not as the only rule. Email addresses change and a misconfigured identity provider can assert any address. Link external identities by issuer and subject, only route by email domain after the tenant has verified it, and require an explicit, logged step to link existing accounts.
Should we build SSO ourselves or use an identity broker?
Building with mature libraries gives control and avoids per-connection fees but leaves protocol maintenance with your team. A broker or managed identity service speeds up per-customer onboarding and provides admin screens. Decide based on expected number of enterprise customers, team experience and budget.
How do we avoid locking a customer out during rollout?
Test each connection in a non-enforcing state with real users, keep break-glass admin accounts with strong MFA, enable enforcement only after successful sign-ins are confirmed, and monitor certificate expiry so rotation never surprises anyone.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- OASIS: SAML V2.0 Technical Overview — accessed 9 November 2026. SAML roles, assertions, bindings, metadata and SP-initiated versus IdP-initiated sign-in.
- OpenID Foundation: OpenID Connect Core 1.0 — accessed 9 November 2026. ID Token claims, authorisation code flow and the ID Token validation steps.
- IETF: RFC 7644, System for Cross-domain Identity Management: Protocol — accessed 9 November 2026. SCIM endpoints, operations including atomic PATCH, filtering and reliance on TLS and bearer tokens.
- NIST: SP 800-63C Revision 4, Federation and Assertions — accessed 9 November 2026. Audience restriction and replay protection for assertions, and provisioning API principles including de-provisioning.
Related reading
Continue your research
Need SAML, OIDC or SCIM support to close enterprise deals?
Tell us about your product, tenancy model and the identity providers your customers use, and we can help you design and deliver an enterprise identity layer.
