You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web - SSO/SAML - User unable to sign out, a new windows always open #90114
Version Number: v9.3.69-3 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#89894 Email or phone of affected tester (no customers):applausetester+saml1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome App Component: Other
When attempting to sign out after signing in via SSO, a new browser window opens and redirects to the Profile page. If you close this window and click 'Sign out' again, the SSO login page will appear again.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #89894 - "Preserve information about saml session when logging out previous user" by @jnowakow (High confidence) Related Issues: N/A
Recommendation: REVERT
PR #89894 introduced a regression in the SAML sign-out flow on web. The fix passes isSAML=true from URL params into the session state (signedInWithSAML: true), which causes the logout path to invoke the SAML single logout (SLO) flow via callSAMLSignOut. On web, that function calls openAuthSessionAsync, which opens a new browser popup — exactly the behavior described in the bug report. The change is small (4 lines), touches only one file, and has a clean revert target.
Assigned: @jnowakow (PR author), @AndrewGable (approving reviewer) Labels: DeployBlockerCash kept (Frontend bug in App PR). No label changes made.
Mechanism: PR Preserve information about saml session when loging out previous user #89894 extracts isSAML from route params and passes it as the second argument to signInWithShortLivedAuthToken(shortLivedAuthToken, !!isSAML). This causes getShortLivedLoginParams to set signedInWithSAML: true in the Onyx SESSION store.
Sign-out path: signOutAndRedirectToSignIn calls signOut({signedInWithSAML: !!session.signedInWithSAML, authToken: session.authToken}). With signedInWithSAML=true, the signOut function branches into callSAMLSignOut.
Root cause behavior: callSAMLSignOut on web calls openAuthSessionAsync, which opens a browser popup directed at the SAML logout URL. The popup opens and redirects to the Profile page (as reported), rather than performing a clean in-app logout.
Root Cause
Before PR #89894, signInWithShortLivedAuthToken was always called without the isSAML flag (defaulting to false), so the session never had signedInWithSAML: true set via the LogOutPreviousUserPage path. After the PR, if a user signs in via SSO (SAML), the isSAML URL param is present, and the session is now marked with signedInWithSAML: true. When the user subsequently signs out via the normal UI path, the SAML single logout (SLO) flow is triggered — opening a new browser window — instead of the standard logout, causing the broken sign-out experience reported.
PR #89894 correctly started preserving the isSAML flag in LogOutPreviousUserPage.tsx:60 so that session.signedInWithSAML is set to true for users who sign in via SSO through OldDot transitions. This means that when these users click "Sign out", the code now takes the SAML logout path via callSAMLSignOut.
callSAMLSignOut uses openAuthSessionAsync to open a popup window to the SAML logout endpoint. After the IdP SLO flow completes, the popup redirects back to CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL. The popup loads the full App, and maybeCompleteAuthSession() runs to send a postMessage back to the opener window to resolve the auth session.
The problem is that maybeCompleteAuthSession (from expo-web-browser) compares the popup's current URL against the stored expected redirect URL. If they don't match (e.g., the SAML backend redirects to a different URL than what CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL resolves to on staging), the auth session silently fails. The popup stays open showing the authenticated app (Profile page), openAuthSessionAsync never resolves with 'success', and when the user closes the popup, it resolves with 'dismiss' causing callSAMLSignOut to reject with "Logout cancelled". The .catch on line 479 just logs a warning, so redirectToSignIn() is never called and the user remains logged in.
What changes do you think we should make in order to solve the problem?
The fix should ensure the SAML logout endpoint query string includes an explicit redirect URL matching the current origin so that the popup redirects back to the correct URL.
In callSAMLSignOut, the web query string currently only passes referer=ecash&authToken=.... It should also include an explicit redirect parameter with CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL (or window.location.origin) so the SAML backend knows exactly where to redirect after logout — ensuring the URL matches what expo-web-browser expects.
If the backend doesn't support a redirect parameter, an alternative approach is to handle the 'dismiss' result from openAuthSessionAsync more gracefully — instead of rejecting the promise, proceed with the LOG_OUT API call anyway (since the SAML IdP session was already terminated by the popup navigation, the only remaining step is invalidating the local Expensify session).
What alternative solutions did you explore? (Optional)
Modifying maybeCompleteAuthSession matching — Could use origin-only comparison instead of full URL, but this is in expo-web-browser (a dependency) and would be fragile.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Activity
melvin-bot commentedon May 9, 2026
@AndrewGable recently merged #89894, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon May 9, 2026
Triggered auto assignment to @stitesExpensify (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon May 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 9, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon May 9, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #89894 - "Preserve information about saml session when logging out previous user" by @jnowakow (High confidence)
Related Issues: N/A
Recommendation: REVERT
PR #89894 introduced a regression in the SAML sign-out flow on web. The fix passes
isSAML=truefrom URL params into the session state (signedInWithSAML: true), which causes the logout path to invoke the SAML single logout (SLO) flow viacallSAMLSignOut. On web, that function callsopenAuthSessionAsync, which opens a new browser popup — exactly the behavior described in the bug report. The change is small (4 lines), touches only one file, and has a clean revert target.Assigned: @jnowakow (PR author), @AndrewGable (approving reviewer)
Labels:
DeployBlockerCashkept (Frontend bug in App PR). No label changes made.Detailed Analysis
Evidence
Verification
src/pages/LogOutPreviousUserPage.tsx— this is the only file changed by PR Preserve information about saml session when loging out previous user #89894isSAMLfrom route params and passes it as the second argument tosignInWithShortLivedAuthToken(shortLivedAuthToken, !!isSAML). This causesgetShortLivedLoginParamsto setsignedInWithSAML: truein the Onyx SESSION store.signOutAndRedirectToSignIncallssignOut({signedInWithSAML: !!session.signedInWithSAML, authToken: session.authToken}). WithsignedInWithSAML=true, thesignOutfunction branches intocallSAMLSignOut.callSAMLSignOuton web callsopenAuthSessionAsync, which opens a browser popup directed at the SAML logout URL. The popup opens and redirects to the Profile page (as reported), rather than performing a clean in-app logout.Root Cause
Before PR #89894,
signInWithShortLivedAuthTokenwas always called without theisSAMLflag (defaulting tofalse), so the session never hadsignedInWithSAML: trueset via theLogOutPreviousUserPagepath. After the PR, if a user signs in via SSO (SAML), theisSAMLURL param is present, and the session is now marked withsignedInWithSAML: true. When the user subsequently signs out via the normal UI path, the SAML single logout (SLO) flow is triggered — opening a new browser window — instead of the standard logout, causing the broken sign-out experience reported.MelvinBot commentedon May 9, 2026
Proposal
What is the root cause of that problem?
PR #89894 correctly started preserving the
isSAMLflag inLogOutPreviousUserPage.tsx:60so thatsession.signedInWithSAMLis set totruefor users who sign in via SSO through OldDot transitions. This means that when these users click "Sign out", the code now takes the SAML logout path viacallSAMLSignOut.callSAMLSignOutusesopenAuthSessionAsyncto open a popup window to the SAML logout endpoint. After the IdP SLO flow completes, the popup redirects back toCONFIG.EXPENSIFY.NEW_EXPENSIFY_URL. The popup loads the full App, andmaybeCompleteAuthSession()runs to send apostMessageback to the opener window to resolve the auth session.The problem is that
maybeCompleteAuthSession(fromexpo-web-browser) compares the popup's current URL against the stored expected redirect URL. If they don't match (e.g., the SAML backend redirects to a different URL than whatCONFIG.EXPENSIFY.NEW_EXPENSIFY_URLresolves to on staging), the auth session silently fails. The popup stays open showing the authenticated app (Profile page),openAuthSessionAsyncnever resolves with'success', and when the user closes the popup, it resolves with'dismiss'causingcallSAMLSignOutto reject with "Logout cancelled". The.catchon line 479 just logs a warning, soredirectToSignIn()is never called and the user remains logged in.What changes do you think we should make in order to solve the problem?
The fix should ensure the SAML logout endpoint query string includes an explicit redirect URL matching the current origin so that the popup redirects back to the correct URL.
In
callSAMLSignOut, the web query string currently only passesreferer=ecash&authToken=.... It should also include an explicitredirectparameter withCONFIG.EXPENSIFY.NEW_EXPENSIFY_URL(orwindow.location.origin) so the SAML backend knows exactly where to redirect after logout — ensuring the URL matches whatexpo-web-browserexpects.If the backend doesn't support a redirect parameter, an alternative approach is to handle the
'dismiss'result fromopenAuthSessionAsyncmore gracefully — instead of rejecting the promise, proceed with theLOG_OUTAPI call anyway (since the SAML IdP session was already terminated by the popup navigation, the only remaining step is invalidating the local Expensify session).What alternative solutions did you explore? (Optional)
maybeCompleteAuthSessionmatching — Could use origin-only comparison instead of full URL, but this is inexpo-web-browser(a dependency) and would be fragile.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.jnowakow commentedon May 11, 2026
@lanitochka17, are use using staging server or production server when testing this?
lanitochka17 commentedon May 11, 2026
stg
Recording.5560.mp4
AndrewGable commentedon May 11, 2026
We are reverting to fix the deploy blocker
m-natarajan commentedon May 11, 2026
Passed, Chrome / v9.3.69-15
REC-20260511224107.mp4