FOUR-31303 | User Is Not Taken to Original URL After Logging In To ProcessMaker via Single Sign On#8849
Open
mcraeteisha wants to merge 1 commit into
Open
FOUR-31303 | User Is Not Taken to Original URL After Logging In To ProcessMaker via Single Sign On#8849mcraeteisha wants to merge 1 commit into
mcraeteisha wants to merge 1 commit into
Conversation
When no intended URL cookie is present, HomeController now checks for a tenant-configured DynamicUI home page and redirects there if available. This preserves per-tenant landing pages while still falling back to the existing requests/home routes. Tests added: INTENDED_DEEP_LINK constant; ensure redirect-to-intended honors the cookie; ensure the intended cookie takes precedence over a DynamicUI home (regression for SAML flow); verify the intended cookie is cleared after use; and verify fallback to route('home') when no cookie and no dashboard is configured.
|
Contributor
|
QA server K8S was successfully deployed https://ci-a7410d005f.engk8s.processmaker.net |
Contributor
|
QA server K8S was successfully deployed https://ci-a7410d005f.engk8s.processmaker.net |
sanjacornelius
approved these changes
Jun 9, 2026
Contributor
|
QA server K8S was successfully deployed https://ci-a7410d005f.engk8s.processmaker.net |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Ticket: FOUR-31303
When an unauthenticated SAML user tries to open a URL (e.g. a web entry), once they are taken to the IdP for authentication, instead of going back to the originally requested URL they are taken to the home page. This also happens when a user loses session and a specific page is reloaded. For example, a user is in the script editor, the page/computer is left idle for a while, and the session expires; reloading the page sends them to the home page instead of staying in the script editor.
Root Cause
The
processmaker_intendedcookie is dropped on the IdP's cross-site POSTLoginController::showLoginForm()sets aprocessmaker_intendedcookie with the originally requested URL before redirecting to SSO. For OAuth providers the callback is a same-site GET, so the cookie is visible. For SAML the callback is the IdP's cross-site POST to/saml2/acs, and browsers do not sendSameSite=Laxcookies on cross-site requests — so the cookie is gone by the timeSSOController::acs()runs.SameSite=Laxonprocessmaker_intendedwas added intentionally by commite68f3c7per the security audit's guidance, so it must stay. The fix uses SAML RelayState instead — a protocol parameter the IdP echoes back in the POST body, which survives the cross-site POST that the Lax cookie cannot.DynamicUI's home page pre-empted the
/redirect-to-intendedrecovery hopHomeController::redirectToIntended()is the recovery hop the SSO callback redirects to when it can't read the cookie itself (a same-site GET, where the Lax cookie becomes visible again). The old fallback ordering checkedpackage-dynamic-ui's configured home page before consulting the cookie, so even when the intended URL was available, the Dynamic UI dashboard would win.Solution
In
package-auth/src/Http/Controllers/SSOController.php,redirect()now copies theprocessmaker_intendedcookie intosaml2_settings.loginRoutebefore invoking the SAML provider.aacotroneo/laravel-saml2forwards that to OneLogin as$returnTo, which puts the intended URL on the outbound AuthRequest asRelayState.callback()then prefers RelayState over the cookie when deciding where to send the freshly-authenticated user, falling back to/redirect-to-intendedonly if neither source yields a usable URL, and a newvalidIntendedUrl()helper rejects cross-host URLs to prevent an attacker-controlled RelayState (or cookie) from turning the SSO callback into an open redirect.In
ProcessMaker/Http/Controllers/HomeController.php,redirectToIntended()now reads the cookie first, and only falls through topackage-dynamic-ui's configured home page when the cookie is absent, restoring the documented redirect chain and ensuring the cookie wins over the configured dashboard.How To Test
Automated
vendor/bin/phpunit tests/Feature/HomeControllerTest.php. Ensure all tests pass.vendor/bin/phpunit vendor/processmaker/package-auth/tests/Feature/Auth/SamlIntendedUrlTest.php. Ensure all tests pass.On the CI Server
/webentry/18/node_1and see the web entry form, not the home/inbox page.https://ci-a7410d005f.engk8s.processmaker.net.ci:deploy
ci:package-auth:bugfix/FOUR-31303
Code Review Checklist