dotCMS / dotCMS/core

[FEATURE] Session Management APIs

Open
#35,193 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #35731 by @hassandotcms — closed without merging
Team : Modernization
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

Active user session management (listing logged-in users, killing sessions) is currently only accessible via DWR calls to UserSessionAjax. Need REST endpoints to answer "Who's logged in and how do I manage sessions?" with proper security (HMAC-obfuscated session IDs, CSRF protection).

Goal

Provide REST endpoints for listing active sessions, killing individual sessions, and killing all sessions. Session IDs must never be exposed to the client — use HMAC obfuscation with time-limited CSRF tokens, matching the security model of the existing DWR implementation.

APIs

  • GET /v1/maintenance/_sessions — List active user sessions with obfuscated tokens
  • DELETE /v1/maintenance/_sessions/{token} — Kill specific session by HMAC token
  • DELETE /v1/maintenance/_sessions — Kill all sessions except caller

Personas

  • Developer Teams — Need REST APIs for Angular Logged Users tab
  • System Administrators — Need to monitor and manage active user sessions

Legacy Reference

  • DWR Class: com.dotcms.cmsmaintenance.ajax.UserSessionAjax
  • JSP: view_cms_maintenance.jsp lines 783–888 (Logged Users tab)
  • Security: HMAC-SHA256 obfuscation with 15-minute CSRF token expiry
  • Target Class: MaintenanceResource.java (/api/v1/maintenance)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MaintenanceResource.java under /api/v1/maintenance and compare the existing behavior in com.dotcms.cmsmaintenance.ajax.UserSessionAjax and view_cms_maintenance.jsp lines 783–888. Verify the three listed endpoints, HMAC-SHA256 token obfuscation, and 15-minute CSRF expiry against the legacy security model. Done means active sessions can be listed, individually killed, or all killed except the caller without exposing session IDs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.