-
Bug
-
Resolution: Not A Defect
-
Critical
-
Jenkins ver. 1.658
active_directory plugin 2.0
Unable to set the "servers" option using groovy on the latest active_directory plugin 2.0. Groovy script used is :
import jenkins.model.* import hudson.security.* import org.jenkinsci.plugins.* import hudson.plugins.* jenkins = jenkins.model.Jenkins.getInstance() adldapRealm = new hudson.plugins.active_directory.ActiveDirectorySecurityRealm( 'domain', 'site', 'bindname', 'bindPassword', 'servers' ) jenkins.setSecurityRealm(adldapRealm) strategy = new FullControlOnceLoggedInAuthorizationStrategy() jenkins.setAuthorizationStrategy(strategy) jenkins.save()
Resulting config:
<authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/> <securityRealm class="hudson.plugins.active_directory.ActiveDirectorySecurityRealm" plugin="active-directory@2.0"> <domains> <hudson.plugins.active__directory.ActiveDirectoryDomain> <name>domain</name> </hudson.plugins.active__directory.ActiveDirectoryDomain> </domains> <site>site</site> <bindName>bindName</bindName> <bindPassword>bindPassword</bindPassword> <groupLookupStrategy>AUTO</groupLookupStrategy> <removeIrrelevantGroups>false</removeIrrelevantGroups> </securityRealm>