probo icon indicating copy to clipboard operation
probo copied to clipboard

Redirect to the org SAML login on SSO-required assume

Open SachaProbo opened this issue 5 months ago • 0 comments

When assuming an organization with a REQUIRED SAML policy, a non-SAML session must re-authenticate through that org's IdP. The console derived the SAML URL from the viewer's email domain (viewer.ssoLoginURL), which errors for domains with zero or multiple SAML configs, so the assume page threw and bounced the user to the email/password screen.

Now ErrSAMLAuthenticationRequired carries the org's SAML configuration ID, the resolver returns the org-specific ssoLoginURL in the SAMLAuthenticationRequired result, and the console redirects straight to it. SAML enforcement stays strict: only the org's own SAML session satisfies a REQUIRED policy.


Summary by cubic

Redirect users to the organization’s SAML login when assuming an org with SAML set to REQUIRED. Uses the org-specific SSO URL to avoid domain-based failures and ensure only the org’s SAML session satisfies the policy.

Service +5 -4

Add SAML configuration ID to ErrSAMLAuthenticationRequired and update NewSAMLAuthenticationRequiredError. In AssumeOrganizationSession, when SAML is REQUIRED and the root session isn’t SAML, return this error with the org’s config ID to force reauth via the org IdP.

GraphQL API +3 -1

Expose ssoLoginURL on SAMLAuthenticationRequired and resolve it from the carried config ID.

App: console +8 -14

Assume page redirects using result.ssoLoginURL and attaches a continue param. Remove viewer.ssoLoginURL and query-string reliance to prevent redirect errors.

Written for commit 3be9136dd45f5bfd45c47d75684e146687d912ca. Summary will update on new commits.

Review in cubic

SachaProbo avatar Jun 12 '26 10:06 SachaProbo