Skip to content
Permalink
Browse files
Merge pull request #70 from fbelzunc/JENKINS-42739
[FIXED JENKINS-42739] NPE thown at login when after AD Plugin update
  • Loading branch information
fbelzunc committed Mar 14, 2017
2 parents 3f16b77 + 2711542 commit 54802d5a26f76fa0ae65028b4bf6a9b7ca9b3780
Showing 2 changed files with 15 additions and 11 deletions.
@@ -325,17 +325,21 @@ public Object readResolve() throws ObjectStreamException {
this.domains.add(new ActiveDirectoryDomain(oldDomain, server));
}
}
// JENKINS-39375 Support a different bindUser per domain
if (bindName != null && bindPassword != null) {
for (ActiveDirectoryDomain activeDirectoryDomain : this.getDomains()) {
activeDirectoryDomain.bindName = bindName;
activeDirectoryDomain.bindPassword = bindPassword;
List <ActiveDirectoryDomain> activeDirectoryDomains = this.getDomains();
// JENKINS-14281 On Windows domain can be indeed null
if (activeDirectoryDomains!= null) {
// JENKINS-39375 Support a different bindUser per domain
if (bindName != null && bindPassword != null) {
for (ActiveDirectoryDomain activeDirectoryDomain : activeDirectoryDomains) {
activeDirectoryDomain.bindName = bindName;
activeDirectoryDomain.bindPassword = bindPassword;
}
}
}
// JENKINS-39423 Make site independent of each domain
if (site != null) {
for (ActiveDirectoryDomain activeDirectoryDomain : this.getDomains()) {
activeDirectoryDomain.site = site;
// JENKINS-39423 Make site independent of each domain
if (site != null) {
for (ActiveDirectoryDomain activeDirectoryDomain : activeDirectoryDomains) {
activeDirectoryDomain.site = site;
}
}
}
if (startTls == null) {
@@ -296,7 +296,7 @@ public UserDetails retrieveUser(final String username, final String password, fi
UserDetails userDetails;
String hashKey = username + "@@" + DigestUtils.sha1Hex(password);
final String bindName = domain.getBindName();
final String bindPassword = domain.getBindPassword().getPlainText();
final String bindPassword = Secret.toString(domain.getBindPassword());
try {
final ActiveDirectoryUserDetail[] cacheMiss = new ActiveDirectoryUserDetail[1];
userDetails = userCache.get(hashKey, new Callable<UserDetails>() {

0 comments on commit 54802d5

Please sign in to comment.