Skip to content

SCAL-311643: Fix SAMLRedirect/OIDCRedirect on IAMv2 (Okta) clusters#534

Open
saurabh-pandey-g wants to merge 1 commit into
mainfrom
SCAL-311643
Open

SCAL-311643: Fix SAMLRedirect/OIDCRedirect on IAMv2 (Okta) clusters#534
saurabh-pandey-g wants to merge 1 commit into
mainfrom
SCAL-311643

Conversation

@saurabh-pandey-g
Copy link
Copy Markdown
Collaborator

doSSOAuth() relied on /callosum/v1/session/isactive to detect a logged-in session. On IAMv2 clusters, browsers commonly block the JSESSIONID cookie from being sent on cross-origin requests (third-party cookie blocking, nested-iframe contexts), so the probe returns 401 even after a successful Okta redirect. The SDK then mistook this for auth failure and fired AuthStatus.FAILURE permanently.

Detect IAMv2 upfront via config.oktaEnabled from /prism/preauth/info and branch around the broken cookie probe: trust the SSO redirect marker as evidence of successful IdP auth and let the iframe re-establish the in-iframe session on load. IAMv1 behavior unchanged.

@saurabh-pandey-g saurabh-pandey-g requested a review from a team as a code owner May 20, 2026 16:44
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@534

commit: 6c4a201

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a specialized authentication flow for IAMv2 (Okta) clusters to circumvent issues caused by third-party cookie blocking in embedded environments. Key changes include the addition of the isIAMv2Enabled utility and logic within doSSOAuth to prioritize SSO markers over the standard cookie-based session probe. New unit tests in auth.spec.ts validate the IAMv2 logic, fallback mechanisms, and backward compatibility with IAMv1. I have no feedback to provide.

doSSOAuth() relied on /callosum/v1/session/isactive to detect a logged-in
session. On IAMv2 clusters, browsers commonly block the JSESSIONID cookie
from being sent on cross-origin requests (third-party cookie blocking,
nested-iframe contexts), so the probe returns 401 even after a successful
Okta redirect. The SDK then mistook this for auth failure and fired
AuthStatus.FAILURE permanently.

Detect IAMv2 upfront via config.oktaEnabled from /prism/preauth/info and
branch around the broken cookie probe: trust the SSO redirect marker as
evidence of successful IdP auth and let the iframe re-establish the
in-iframe session on load. IAMv1 behavior unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant