Identity infrastructure · · 7 min read
Enterprise SSO: the parts nobody tells you
By the Argenium team
Enterprise single sign-on looks like a protocol problem. Getting a SAML or OIDC login working takes a day. What takes the next six months is lifecycle and trust: who may claim which users, how accounts get linked, and what happens when someone leaves the customer’s company.
SAML, OIDC, and a library
You will end up supporting both. OIDC is the simpler protocol and the better default for new connections; SAML is still what many enterprise identity providers are configured for. Whichever you implement, do it through a well-maintained library. SAML in particular has a long history of signature-wrapping bugs, where a signature is checked on one part of the XML and data is read from another.
Validate everything the assertion claims: the signature over the element you actually consume, the audience, the recipient URL, the validity window, and, for flows you started, that InResponseTo matches the request you issued.
Domain verification comes first
Sign-in usually starts with an email address that routes the user to their company’s identity provider. That routing is a security decision. If any tenant can claim @bigcorp.com without proof, an attacker can set up a connection and have BigCorp’s employees sign in through an identity provider they control. Require proof of domain ownership, typically a DNS TXT record, before a connection may claim a domain.
Account linking is where takeovers happen
A user who signed up with a password last year now arrives through SSO with the same email address. Linking the two automatically is convenient, and it trusts that the identity provider’s email claim is verified and authoritative. That holds for the customer’s own verified domain. It does not hold for an arbitrary connection asserting an arbitrary address.
- Link automatically only when the connection owns the verified domain and the email is in that domain.
- Otherwise, ask the user to prove control of the existing account before linking.
- Key accounts on the identity provider’s stable subject identifier, not on the email address, which can change.
Be careful with IdP-initiated sign-in
In IdP-initiated SAML, the user clicks a tile in their company portal and arrives with an assertion you never asked for. There is no request to tie it to, so it cannot be bound to the browser session that receives it. Customers will want it anyway. If you support it, accept each assertion only once, keep validity windows short, and always land the user on a fixed page rather than a URL taken from the request.
Just-in-time is not provisioning
Just-in-time provisioning creates an account the first time someone signs in. It never removes one. When a person leaves the customer, their identity provider stops letting them in, but any session they already have with you keeps working, and their account keeps its access.
SCIM (RFC 7643 and RFC 7644) closes the loop: the customer’s directory tells you when users are created, changed and deactivated. Treat deactivation as an authentication event: end every session and revoke every token for that user, immediately.
Enforcement and the break-glass account
- Enforce per tenant. Once SSO is required, members of that tenant can no longer sign in with a password or a social login.
- Keep one way back in. If the customer’s identity provider breaks, someone needs a strongly authenticated, audited path to fix the configuration.
- Show the customer what you see. Connection status, last successful sign-in and recent errors save days of back-and-forth.