Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create a local user in jenkins along side LDAP authentication

Tags:

jenkins

The purpose is to create a local user in jenkins(granting admin rights) along side the LDAP group authentication so that this "local" user can perform all admin actions whenever the LDAP authentication is not working. I can set up active directory user(valid users with a valid id), but i want to explore the possibility of setting up "local" jenkins user I tried to figure this out through JENKINS JIRA but there is no mention of jenkins local user.

Can anyone help me figure this out.

like image 683
anonymous Avatar asked Nov 23 '18 07:11

anonymous


People also ask

How does LDAP authentication between a client and server work?

In short, a client sends a request for information stored within an LDAP database along with the user's credentials to an LDAP server. The LDAP server then authenticates the credentials submitted by the user against their core user identity, which is stored in the LDAP database.

Does Jenkins support Active Directory?

Jenkins recognizes all the groups in Active Directory that the user belongs to, so you can use those to make authorization decisions (for example you can choose the matrix-based security as the authorization strategy and perhaps allow "Domain Admins" to administer Jenkins).


Video Answer


3 Answers

You can't.

When you activate LDAP authentication, you automatically disable Jenkins' internal user database. Both cannot co-exist.

like image 140
Jean-Philippe Briend Avatar answered Oct 04 '22 03:10

Jean-Philippe Briend


There is an improvement filed here to support local users and LDAP users at the same time: https://issues.jenkins-ci.org/browse/JENKINS-3404

like image 26
schowave Avatar answered Oct 04 '22 04:10

schowave


I agree with the accepted answer in that Jenkins does not currently appear to support the simultaneous use of internal authentication and LDAP authentication.

That said, what I do to work around this is:

  1. Run a local copy (i.e. on the Jenkins system itself) of slapd
  2. Configure Jenkins with LDAP authentication, and point him to both my local LDAP directory and our organization's directory

See screenshots: Configure multiple LDAP directories

Set up local directory

By doing so, I'm able to create (within the local LDAP instance) a handful of service accounts, and also utilize my org's LDAP authentication for everything else. (On a side note, I use the "Project-based Matrix Authorization Strategy" to manage authz.)

Setting up a local directory is more effort at the outset, but it solves the problem you are describing -- at least until a better solution is available.

like image 29
ecs-hk Avatar answered Oct 04 '22 04:10

ecs-hk