Active Directory Plugin: set specific attribute to match against

I have successfully set up Jenkins with AD plugin a while ago and it works almost like a charm with Microsoft AD.

The only thing I am not happy with is users able to authenticate using either john.doe or john.doe@ad.domain or john.doe@mail.domain. It’s fine when user record already exists in Jenkins. Hoverer creates different looking user on users’ first login. So ‘People’ tab looks as a zoo.

Is it possible to configure the plugin to match against a specific attribute like sAMAccountName and create user records based on that attribute?

I looked at the plugin source code and it does not look like there is any option to do what you want. You could file a ticket in Jira for the feature, or try implementing it yourself and submitting a PR.

Thanks Alex. It seems the bug is already reported in JENKINS-59448
Let’s hope it will be implemented at some point.

For now the workaround is to delete duplicated users from users folder on the disk and reload config.