凭据不能用于NTLM身份验证

时间:2017-12-08 10:32:54

标签: java

我收到org.apache.commons.httpclient.auth.InvalidCredentialsException:凭据不能用于NTLM身份验证:eclipse中的异常

是否有可能提到eclipse直接采用系统代理设置?

p = [3,2]
xs = p[0] + [-1,0,1]
ys = p[1] + [-1,0,1]
res = np.transpose([np.tile(xs, len(ys)), np.repeat(ys, len(xs))])

例外:

  

2017年12月8日下午1:41:39           org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme          信息:选择了ntlm身份验证方案        2017年12月8日下午1:41:39 org.apache.commons.httpclient.HttpMethodDirector executeConnect          严重:凭据不能用于NTLM身份验证:            org.apache.commons.httpclient.UsernamePasswordCredentials            org.apache.commons.httpclient.auth.InvalidCredentialsException:凭据          不能用于NTLM身份验证:         while read -r a b c _ d rest; do : things with "$a", "$b", "$c", and "$d" done <inputfile           org.apache.commons.httpclient.UsernamePasswordCredentials       在org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:332)         在org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320)       在org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:491)       在org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:391)       在org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)       在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)       在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)       在HttpGetProxy.main(HttpGetProxy.java:31)
  2017年12月8日下午1:41:39 org.apache.commons.httpclient.HttpMethodDirector processProxyAuthChallenge   信息:使用NTLM @proxy进行身份验证失败。****。com:6050

2 个答案:

答案 0 :(得分:0)

我认为您需要在“用户名”字段中使用域\用户名形式的凭据,才能使NTLM身份验证正常工作。

答案 1 :(得分:0)

根据documentation,支持以下身份验证方案:基本,摘要,NTLM,SPNEGO,Kerberos

尤其是:

NTLM:NTLM是由以下人员开发的专有身份验证方案: Microsoft并针对Windows平台进行了优化。 NTLM被认为是 比摘要更安全。

因此,为了避免出现此警告,请使用以下CredentialProvider:

CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(AuthScope.ANY, new NTCredentials("user", "pwd", "", "domain"));