jenkinsci / jenkinsci/active-directory-plugin

[JENKINS-28858] More aggressive group membership caching

Open
#455 0 comments 0 reactions 0 assignees View on GitHub
component:active-directory-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
53
Forks
115
PR merge metrics
No merged PRs in 30d

Description

In too many organizations, AD is too large and login takes too long. The bulk of this time is spent on looking up group memberships.

We should do more aggressive caching of the memberships to cut down this cost. In particular, we should cache the map from DN of group/user to its memberOf attributes.

We can have a long cache retention value (say 24hrs?) to improve the out of the box experience.

Where this hurts is when a group membership changes. Possible mitigations are:


  • Let the user login immediately, but uses that loging credential in the background to recompute membership asynchronously. When the result is available, update the group list after the fact.

  • Expose a method for Groovy script to purge the cache

  • Have a system property to control the cache timeout

---
Originally reported by kohsuke, imported from: More aggressive group membership caching


  • status: Open
  • priority: Major
  • component(s): active-directory-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

In too many organizations, AD is too large and login takes too long. The bulk of this time is spent on looking up group memberships.

We should do more aggressive caching of the memberships to cut down this cost. In particular, we should cache the map from DN of group/user to its memberOf attributes.

We can have a long cache retention value (say 24hrs?) to improve the out of the box experience.

Where this hurts is when a group membership changes. Possible mitigations are:


  • Let the user login immediately, but uses that loging credential in the background to recompute membership asynchronously. When the result is available, update the group list after the fact.

  • Expose a method for Groovy script to purge the cache

  • Have a system property to control the cache timeout


Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing the active-directory-plugin's group membership lookup and determine how DN-to-memberOf results could be cached. Define the retention and membership-change behavior, including the proposed 24-hour timeout and possible purge, asynchronous refresh, or system-property controls.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.