且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTTP 请求未经客户端身份验证方案“Ntlm"授权.从服务器收到的身份验证标头是“协商,NTLM"

更新时间:2021-11-24 00:43:50

您可以通过使用 wftech,这是一个旧工具,但我发现它在诊断身份验证问题方面很有用.wfetch 允许您指定 NTLM、Negotiate 和 kerberos,这可能有助于您更好地了解您的问题.当您尝试调用服务而 wfetch 对 WCF 一无所知时,我建议将您的终结点绑定 (PROVIDERSSoapBinding) 应用到 serviceMetadata 然后您可以使用相同的安全设置为服务执行 WSDL 的 HTTP GET.

You can eliminate the client from the problem by using wftech, this is an old tool but I have found it useful in diagnosing authentication issues. wfetch allows you to specify NTLM, Negotiate and kerberos, this may well help you better understand your problem. As you are trying to call a service and wfetch knows nothing about WCF, I would suggest applying your endpoint binding (PROVIDERSSoapBinding) to the serviceMetadata then you can do an HTTP GET of the WSDL for the service with the same security settings.

您可能可以使用的另一个选项是强制服务器使用 NTLM,您可以通过编辑元数据库 (IIS 6) 并删除协商设置来执行此操作,更多详细信息请参见 http://support.microsoft.com/kb/215383.

Another option, which may be available to you is to force the server to use NTLM, you can do this by either editing the metabase (IIS 6) and removing the Negotiate setting, more details at http://support.microsoft.com/kb/215383.

如果您使用的是 IIS 7.x,则方法略有不同,有关如何配置身份验证提供程序的详细信息在此处 http://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication.

If you are using IIS 7.x then the approach is slightly different, details of how to configure the authentication providers are here http://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication.

我注意到你用xxx.xx.xx.xxx屏蔽了服务器地址,所以我猜这是一个IP地址而不是服务器名称,这可能会导致身份验证问题,所以如果可能的话尝试以机器名称为目标.

I notice that you have blocked out the server address with xxx.xx.xx.xxx, so I'm guessing that this is an IP address rather than a server name, this may cause issues with authentication, so if possible try targeting the machine name.

很抱歉,我没有给您答案,而是提供了让您更接近问题的指示,但我希望它有所帮助.

Sorry that I haven't given you the answer but rather pointers for getting closer to the issue, but I hope it helps.

最后我会说我遇到了同样的问题,我唯一的办法是使用 Kerberos 而不是 NTLM,请不要忘记,如果您确实沿着这条路线走,则需要为该服务注册一个 SPN.

I'll finish by saying that I have experienced this same issue and my only recourse was to use Kerberos rather than NTLM, don't forget you'll need to register an SPN for the service if you do go down this route.