HTTP 请求未经客户端身份验证方案“匿名”的授权。从服务器收到的身份验证标头是“NTLM”;

发布于 2024-12-09 01:43:50 字数 2010 浏览 0 评论 0 原文

我有一个用 VB.NET 编写的 ASP.NET Web 应用程序。应用程序的一部分对内部 ASMX 文件进行 AJAX 调用,该文件又对远程 Web 服务进行调用,而远程 Web 服务只是一个 ASMX 文件。通常情况下,这工作得很好,并且已经部署了几次并且工作得很好。然而,一个客户端正在从 AJAX 调用获取消息:

HTTP 请求未经客户端身份验证方案授权 '匿名的'。从服务器收到的身份验证标头是 “NTLM”。

我已经搜索了大量的网站试图解决这个问题,但我似乎找不到任何适合我的答案。

我一直无法在我的测试服务器上复制该错误,该服务器与客户端相同,Win2003 IIS6。

远程Web服务部署在Windows 2008 r2 – IIS7.5上。仅使用“匿名”身份验证来部署远程服务。客户端部署使用匿名和“集成 Windows 身份验证”进行设置。我已尝试更改两种实现的身份验证级别,但无法复制该问题。我最接近的是当我将远程服务 IIS 身份验证设置为

HTTP 请求未经客户端身份验证方案授权 'Ntlm'。从服务器收到的身份验证标头是“”。

在 web.config 文件中,对远程服务的引用是:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                    <message clientCredentialType="UserName" algorithmSuite="Default"/>
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
    </client>
</system.serviceModel>

我已尝试更改 部分中的许多设置,但仍然无法复制。

I have an ASP.NET web application written in VB.NET. One part of the application makes an AJAX call to an internal ASMX file which in turn makes a call to a remote web service which is just a single ASMX file. Normally this works fine and has been deployed a couple of times and works fine. One client however, is getting the message from the AJAX call:

The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was
'NTLM’.

I have scoured a large amount of websites trying to fix this but I can’t seem to find any answer that works for me.

I have been unable to replicate the error on my test server, which is the same as the client, Win2003 IIS6.

The remote web service is deployed on Windows 2008 r2 – IIS7.5. The remote service is deployed using ‘Anonymous’ authentication only. The client deployment is set up with Anonymous and ‘Integrated Windows Authentication’. I have tried changing the authentication levels on both implementations but cannot replicate the issue. The closest I have come is when I set the remote service IIS authentication to

The HTTP request is unauthorized with client authentication scheme
'Ntlm'. The authentication header received from the server was ''.

In the web.config file the reference to the remote service is:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                    <message clientCredentialType="UserName" algorithmSuite="Default"/>
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
    </client>
</system.serviceModel>

I have tried changing a number of the setting in the <security> section but still unable to replicate.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

过气美图社 2024-12-16 01:43:50

我不确定您的整个服务器设置。

<security mode="None">
  <transport clientCredentialType="None" proxyCredentialType="None"    realm=""/>
</security>

请尝试使用以下配置,而不是上面的配置

<security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm"/>
    <message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>

,请访问以下链接,您可以对这些链接有更多了解,并且可以根据您的要求更改配置:

I am not sure of your total server setup.

<security mode="None">
  <transport clientCredentialType="None" proxyCredentialType="None"    realm=""/>
</security>

instead of above one please try with below configuration

<security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm"/>
    <message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>

please go through below links, you can more idea on those and you can change the config based on your requirements:

晒暮凉 2024-12-16 01:43:50

我必须将默认生成的更改

      <security mode="Transport"/>

      <security mode="Transport" >
        <transport clientCredentialType="Ntlm"/>
      </security>

I had to change the default generated

      <security mode="Transport"/>

into

      <security mode="Transport" >
        <transport clientCredentialType="Ntlm"/>
      </security>
又怨 2024-12-16 01:43:50

对于这个问题还有一个评论:

如果您不使用 HTTPS,

<security mode="Transport"/>

则不支持。你可以用

<security mode="TransportCredentialOnly">

它代替。

One more comment for this problem:

If you are not using HTTPS,

<security mode="Transport"/>

is not supported. You can use

<security mode="TransportCredentialOnly">

instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文