Agent Wranglers

ACC-58Recommended

Connect single sign-on per organisation

Let each business organisation connect its own identity provider through SAML 2.0 or OpenID Connect, and route its users there by verified email domain.

How to do it

Store one connection per organisation, with the provider's metadata or issuer. Ask for the email first, then send people from a verified domain to their provider. Match returning users by the provider's stable ID, as keep your own user ID says. Create users on first sign-in only when the organisation allows it. Keep sign-in started by the provider, called IdP-initiated SAML, off unless a customer needs it. Run OpenID Connect connections as let people sign in with an account they already have says. For SAML, use a maintained library and keep it patched, because signature wrapping keeps breaking them, as in ruby-saml CVE-2024-45409 and CVE-2025-25291. Use only the assertion the signature covers. Check Audience, Recipient, InResponseTo and NotOnOrAfter, and refuse an assertion ID seen before.

How to check

On staging, start sign-in as ana@acme.example. The browser goes to Acme's test provider. Start as bo@other.example, and the normal sign-in page appears. Send an unsigned SAML assertion, a signed one wrapped around a second unsigned assertion, one for another audience, an expired one and a replay. Each sign-in fails.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/accounts/business-sign-on-and-provisioning/organisation-sso">Agent Wranglers accounts and identity playbook</a>. In code you write, add a comment next to it with the same link.