简体   繁体   English

如何使用XML响应进行curl NTLM身份验证

[英]How to do curl ntlm authentication with an xml response

I am trying to get a xml response from the server, but im getting this: SPNEGO cannot find mechanisms to negotiate 我正在尝试从服务器获取xml响应,但我正在获取此信息:SPNEGO无法找到协商机制

Do you guys know how to proceed ? 你们知道如何进行吗?

$ curl http://example.com:86/DynamicsNAV80/WS/nasr/Page/Delivery -v --ntlm --negotiate -u nasr\\jason:tty5Rx53$_sj
* Hostname was NOT found in DNS cache
*   Trying 21.55.152.170...
* Connected to example.com (21.55.152.170) port 86 (#0)
> GET /DynamicsNAV80/WS/nasr/Page/Delivery HTTP/1.1
> User-Agent: curl/7.38.0
> Host: example.com:86
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: Negotiate
< Date: Sun, 11 Mar 2018 23:20:34 GMT
< 
* Connection #0 to host example.com left intact
* Issue another request to this URL: 'http://example.com:86/DynamicsNAV80/WS/nasr/Page/Delivery'
* Found bundle for host example.com: 0x5558f1e0d4e0
* Re-using existing connection! (#0) with host example.com
* Connected to example.com (21.55.152.170) port 86 (#0)
> GET /DynamicsNAV80/WS/nasr/Page/Delivery HTTP/1.1
> User-Agent: curl/7.38.0
> Host: example.com:86
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
* gss_init_sec_context() failed: : SPNEGO cannot find mechanisms to negotiate
< WWW-Authenticate: Negotiate
< Date: Sun, 11 Mar 2018 23:20:34 GMT
< 
* Connection #0 to host example.com left intact

Try upgrading your curl version. 尝试升级您的curl版本。 I got the same issue previously (HTTP/1.1 401 Unauthorized). 我之前遇到过相同的问题(HTTP / 1.1 401未经授权)。 Once I upgraded the curl to 7.45.0 (or latest), the issue got resolved. 将curl升级到7.45.0(或最新版本)后,问题就解决了。 Please go through the images below for better understanding. 请浏览下面的图片,以更好地理解。

Issue with the curl version 7.38.0. curl版本7.38.0的问题。 NTLM is disabled: NTLM已禁用:
curl版本7.38.0的问题。 NTLM已禁用

Issue resolved with the curl version 7.45.0. curl版本7.45.0解决了问题。 NTLM is enabled as well as some other parameters too.: NTLM以及其他一些参数也已启用。:
curl版本7.45.0解决了问题。 NTLM以及其他一些参数也被启用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM