jenkinsci / jenkinsci/active-directory-plugin

[JENKINS-8287] Append domain name to the username

Open
#326 2 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 my setup Hudson is using a svn server where users are reported in the following format: USER@​DOMAIN.EXT.

Unfortunately, when I log in Hudson through Active Directory, the created user is only USER thus it does not match the discovered users through svn.

My patch modify two things:



  • the method getPrincipalName() so that if the user log in as USER@​DOMAIN.EXT the code does not transform it to USER@​DOMAIN.EXT.DOMAIN.EXT.

  • the returned name is the principalName variable, that is the full username with the domain information.

My patch only modify the ActiveDirectoryUnixAuthenticationProvider class, the other authentication provider used when Hudson is running on Windows was not modified, I have to test environment to do this change.

I also see that my change conflicts with JENKINS-5773, so I am wondering if we should not add a new configuration parameter where we can define a pattern for the username?

---
Originally reported by rborer, imported from: Append domain name to the username


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

Raw content of original issue

In my setup Hudson is using a svn server where users are reported in the following format: USER@DOMAIN.EXT.

Unfortunately, when I log in Hudson through Active Directory, the created user is only USER thus it does not match the discovered users through svn.

My patch modify two things:



  • the method getPrincipalName() so that if the user log in as USER@DOMAIN.EXT the code does not transform it to USER@DOMAIN.EXT.DOMAIN.EXT.

  • the returned name is the principalName variable, that is the full username with the domain information.

My patch only modify the ActiveDirectoryUnixAuthenticationProvider class, the other authentication provider used when Hudson is running on Windows was not modified, I have to test environment to do this change.

I also see that my change conflicts with JENKINS-5773, so I am wondering if we should not add a new configuration parameter where we can define a pattern for the username?

  • environment: Hudson 1.388 with active directory plugin version 1.17, running under Linux

1 attachment

- [active_directory.patch](https://issues.jenkins.io/secure/attachment/20071/active_directory.patch)

Contributor guide

Open the contributing guide

Research direction

Start by locating ActiveDirectoryUnixAuthenticationProvider and its getPrincipalName() method, then review the attached active_directory.patch and the conflicting JENKINS-5773 issue. Check how the Unix provider handles usernames containing a domain and whether the Windows provider is in scope. Done means the intended full username format is defined without duplicated domain information and covered across the relevant provider behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.