CAS 8.0.0 Palantir

26 views
Skip to first unread message

Colin Wilkinson

unread,
Apr 1, 2026, 1:24:46 AMApr 1
to CAS Community
Hi Guys,

There are issues with the changes made to palantir in CAS 8.0.0, it keeps session timing out.

In palantir-dashboard.js you have

```js
async function initializePalantirSession() {
    setInterval(async () => {
        const url = new URL(location.href);
        const result = await fetch(`${url.pathname}/session`, { credentials: "include" });
        if (result.status !== 200) {
            Swal.close();
            Swal.fire({
                title: "Session Expired",
                text: "Your Palantir session has expired. The dashboard will reload shortly.",
                icon: "info",
                timer: 3000,
                timerProgressBar: true,
                showConfirmButton: false
            }).then((result) => {
                if (result.dismiss === Swal.DismissReason.timer) {
                    activateDashboardTab(Tabs.LOGOUT.index);
                }
            });

        }
    }, 15000);
}
```

But in the DashboardController.java you have
```java
    @GetMapping("/dashboard/session")
    @Operation(summary = "Get active session", description = "Gets active authenticated session")
    public ResponseEntity fetchSession(final HttpServletRequest request) {
        val auth = SecurityContextHolder.getContext().getAuthentication();
        val authenticated = auth != null && auth.isAuthenticated() && !(auth instanceof AnonymousAuthenticationToken);
        val session = request.getSession(false);

        if (!authenticated || session == null) {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
        }
        return ResponseEntity.ok(Map.of(
            "name", auth.getName(),
            "id", session.getId()
        ));
    }
```

The  mapping above has path = {StringUtils.EMPTY, "/dashboard", "/"}

should this mapping be path = {"/dashboard/session", "/session"}

otherwise the the js will need to be change from
```js
const result = await fetch(`${url.pathname}/session`, { credentials: "include" });
```
to
```js
const result = await fetch(`${url.pathname}/dashboard/session`, { credentials: "include" });
```

Regards,
Colin

Reply all
Reply to author
Forward
0 new messages