-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathLdap.groovy
24 lines (24 loc) · 860 Bytes
/
Ldap.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Configure global security realm
def ldap = { instance, ldap_addr, ldap_rootDN, ldap_managerDN, ldap_managerPass, ldap_userSearchBase='', ldap_userSearch='uid={0}', ldap_groupSearchBase='' ->
def securityRealm = new hudson.security.LDAPSecurityRealm(
server=ldap_addr,
rootDN=ldap_rootDN,
userSearchBase='',
userSearch='uid={0}',
groupSearchBase='',
groupSearchFilter='',
groupMembershipStrategy=null,
managerDN=ldap_managerDN,
managerPasswordSecret=hudson.util.Secret.fromString(ldap_managerPass),
inhibitInferRootDN=false,
disableMailAddressResolver=false,
cache=null,
environmentProperties=null,
displayNameAttributeName='',
mailAddressAttributeName='',
userIdStrategy=null,
groupIdStrategy=null
)
instance.setSecurityRealm(securityRealm)
println "Setting LDAP Security Realm"
}