Redirect to the org SAML login on SSO-required assume

Closed
SA
6mo ago
+16-19

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 using 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.