[JENKINS-46288] - Fix ProxyConfiguration validation for NTLM authentication (#2984)

/**
     * Constructor.
     * @param userName The user name.  This should not include the domain to authenticate with.
     * For example: "user" is correct whereas "DOMAIN\\user" is not.
     * @param password The password.
     * @param host The host the authentication request is originating from.  Essentially, the
     * computer name for this machine.
     * @param domain The domain to authenticate within.
     */

(cherry picked from commit ccb3e4cd50)
This commit is contained in:
bale836 authored and Oliver Gondža committed 2017-09-04 15:54:41 +02:00
1 parent 66e199dcff
commit 593f707eaa
1 file changed
+1 -1
@@ -396,7 +396,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
if (userName.indexOf('\\') >= 0){
final String domain = userName.substring(0, userName.indexOf('\\'));
final String user = userName.substring(userName.indexOf('\\') + 1);
return new NTCredentials(user, Secret.fromString(password).getPlainText(), domain, "");
return new NTCredentials(user, Secret.fromString(password).getPlainText(), "", domain);
} else {
return new UsernamePasswordCredentials(userName, Secret.fromString(password).getPlainText());
}