Skip to content

com_tools: set the weber-auth cookie when the launch interstitial con… - #1970

Merged
nkissebe merged 1 commit into
hubzero:2.4-mainfrom
denphi:fix/tools-launch-weber-auth-cookie
Nov 4, 2026
Merged

nkissebe merged 1 commit into
hubzero:2.4-mainfrom
denphi:fix/tools-launch-weber-auth-cookie

Conversation

@denphi

@denphi denphi commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Problem

Jupyter (weber) tools launched through the new async launch interstitial are refused by the weber proxy. Opening the same running session from the dashboard works.

The interstitial gets redirect_url from GET /api/tools/{sess} (Sessionsv1_0::readTask). That runs the middleware view command and returns weber_auth in the JSON, but never sets the weber-auth-<domain> cookie. Only the site session viewer (Sessions::viewTask) set it, so the browser reached the proxy without the cookie. The dashboard link goes through viewTask, which is why it worked there.

Fix

  • Move the cookie code into Utils::setWeberAuthCookie($output).
  • Call it from viewTask (no change in behavior) and from readTask (the fix). The interstitial's XHR is same-origin, so the browser stores the cookie before it is sent on to redirect_url.
  • Build the cookie domain from Request::root() instead of Request::base(). On the site they are the same. root() drops a trailing /api, so the domain stays the bare host when the helper is called from the API.

Testing

  • php -l passes on all three files (php:8.2-cli).
  • Not yet tested end-to-end against a live weber proxy. To check: launch a Jupyter tool with DevTools → Network open. The /api/tools/<sess> response should carry Set-Cookie: weber-auth-<host>=…, and the redirect should open Jupyter without going through the dashboard.

🤖 Generated with Claude Code

…nects

Jupyter (weber) tools launched through the async interstitial were refused
by the proxy. The interstitial gets redirect_url from GET /api/tools/{sess}
(readTask), which runs the middleware "view" command but never set the
weber-auth cookie from its weber_auth value -- only the site session viewer
(viewTask) did. The browser therefore reached the proxy without the cookie.
Opening the same session from the dashboard worked because that goes
through viewTask.

Move the cookie code into Utils::setWeberAuthCookie() and call it from both
viewTask and readTask. It uses Request::root() instead of Request::base()
for the cookie domain; they are identical on the site, and root() drops a
trailing /api so the domain stays the bare host when called from the API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@denphi
denphi requested a review from nkissebe as a code owner November 4, 2026 01:49
@nkissebe
nkissebe merged commit 9abf72f into hubzero:2.4-main Nov 4, 2026
2 checks passed
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.

2 participants