prajwal-jadhav01 commented on PR #18933:
URL: https://github.com/apache/pinot/pull/18933#issuecomment-7311819577

   I tested this locally to help with the manual test plan.
   
   **Setup:** commit `632787d` (the UI reports `Pinot-Controller-Version: 
1.6.0-SNAPSHOT-632787d4c8`), Temurin JDK 25.0.5.1, `QuickStart -type AUTH` with 
`controller.ui.session.authentication.enabled=true`, `cookie.secure=false`, 
inactivity timeout 120s. Cluster ran on Ubuntu under WSL2. Browser: Chromium 
151, with the UI steps driven by Playwright and DevTools open. For T9, a second 
controller ran on :9001 against the same ZooKeeper with the same session 
settings.
   
   | # | Check | Result |
   |---|---|---|
   | T1 | No `Authorization` header on UI requests after login | PASS: 0 of 85 
UI requests carried `Authorization`; XHRs carry only `Cookie: 
Pinot-UI-Session=…` |
   | T2 | `Pinot-UI-Session` cookie is HttpOnly + SameSite=Strict | PASS: 
HttpOnly ✓, SameSite=Strict, `document.cookie` is empty |
   | T3 | After logout, the old cookie gets 401 on `/auth/session` | PASS on 
the server side (200 before, 401 `{"error":"Session expired"}` after). **But 
the UI does not go to the login page**, see below |
   | T4 | Refresh, then logout (the app_state concern above) | **FAIL**: after 
F5 the logout button is gone, so the user can't log out; the server session 
stays valid (200) |
   | T5 | Query console works with session auth | PASS: `POST /sql` returned 
200 with results |
   | T6 | `curl -u admin:verysecret /tables` still works | PASS: 200 (401 
without credentials) |
   | T7 | Wrong password: error, no cookie | PASS: "Invalid Username/Password", 
`/auth/login` 401, no cookie set |
   | T8 | Idle timeout warning + auto-logout | PASS: warning dialog at ~58s, 
auto-logout to `/#/login` at ~118s, old cookie then 401 |
   | T9 | Cookie from controller A on controller B | B rejects it: 
`/auth/session` 401 and `/tables` 401. So sticky sessions really are required 
behind a load balancer |
   
   **T4 (confirms @xiangfu0's first concern):** log in, the logout icon is in 
the header. Press F5: you stay logged in (AuthProvider restores auth via 
`/auth/session`), but the logout icon disappears. `Header.tsx` shows the icon 
only when `app_state.authWorkflow` is `SESSION` or `BASIC`, and only 
`LoginPage` sets that field, so it is undefined after a reload. 
`app_state.username` isn't restored either. Restoring `app_state.authWorkflow` 
and `username` in the AuthProvider SESSION branch when `/auth/session` returns 
200 would probably fix both.
   
   **T3, UI side:** clicking Logout kills the server session, but the page 
stays on `/#/` (checked 8s later), with empty cards and a toast "Failed to load 
periodic tasks: e.data.map is not a function". The login form only appears 
after a manual reload. `Header.handleLogout` clears `app_state` and calls 
`history.push('/login')`, but App's `isAuthenticated` state is still `true`, so 
`loginRender` pushes back to `/`. The idle-timeout path 
(`performSessionLogout`) calls `setIsAuthenticated(false)` and works as 
expected (T8).
   
   <img width="1440" height="860" alt="T1_devtools_request_headers" 
src="https://github.com/user-attachments/assets/0df76613-9dcd-4605-9d1d-b663f6113182";
 />
   <img width="1440" height="860" alt="T3_ui_after_logout_8s" 
src="https://github.com/user-attachments/assets/85be55fc-f478-4b75-9951-caa232e4456b";
 />
   <img width="1440" height="860" alt="T4_2_after_refresh" 
src="https://github.com/user-attachments/assets/f59fee40-925c-44bf-a3f1-3b1407ec5c7f";
 />
   
   
   Minor nits:
   - `/auth/session` on controller B returns `"Session expired"` for a session 
it never issued. "Invalid session" would be less confusing for operators 
debugging a missing sticky-session setup.
   - Some Javadoc still says `controller.ui.session.enabled` 
(SessionAuthenticationFilter, PinotSessionLoginResource), and 
PinotSessionLoginResource says sessions expire after 8 hours. The actual key is 
`controller.ui.session.authentication.enabled`, and the TTL follows the 
inactivity timeout.
   
   Happy to re-run after the next update.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to