Skip to main content
  1. Posts/

How to enable, configure and disable Jenkins LDAP

·183 words·1 min· ·
Xianpeng Shen
Author
Xianpeng Shen
DevOps & Build Engineer | Python Enthusiast | Open Source Maintainer
Table of Contents

Introduction
#

In organizations, using LDAP login very common way for users to log in with their credentials.

How to configure LDAP
#

Preparation: Installed LDAP Jenkins plugin

LDAP plugin

About how to configure it, you can refer to Jenkins LDAP Plugin documentation https://plugins.jenkins.io/ldap/

This is my LDAP configuration just for testing.

LDAP configure1

LDAP configure2

Can not login with LDAP?
#

Sometimes, for some reason, there is a problem with your organization’s LDAP server and you can’t log in to Jenkins using LDAP, but you need to use Jenkins now.

You can disable LDAP authentication by changing config.xml.

# Login, cd to jenkins server folder
$ cd /var/lib/jenkins/

# Highly rememend you to backup config.xml before making any change !!!
# If you don't backup config.xml, you'll lost your LDAP configration after reboot service.
$ cp config.xml config.xml.bak

# Modify config.xml from
<useSecurity>true</useSecurity>
# To
<useSecurity>false</useSecurity>

# Restart Jenkins server
sudo service jenkins restart

Then you can log into the Jenkins server again.

Once your organization’s LDAP works again, you can replace config.xml with your backup config.xml file. Then your users can continue to log in via LDAP.

Related

Jenkins Multibranch Pipeline

·405 words·2 mins
Discusses the use of Jenkins Multibranch Pipeline to manage multiple branches in a project, enabling parallel builds for pull requests and efficient code review processes.