【发布时间】:2012-04-10 18:36:22
【问题描述】:
1) 在机器 A 上 - 我创建了 WCF 服务并将其托管在机器 A 上的 IIS 5.1 上。它在此 URL http://mydomain/SetupPOCService/Service1.svc 下运行
2) 在机器 B 上 - 我创建了一个 Asp.net Web Applciation。在这个应用程序中,我尝试使用之前创建的 WCF 服务,该服务现在托管在另一个 m/c 上,即 MachineA。 当我从 Visual Studio 环境运行这个 Web 应用程序时,它会访问 MachineA 的 WCF 服务并获取数据。
---到这里为止---
3) 在机器 B 上 - 现在我在 IIS5.1 中托管了我的 Web 应用程序 此 Web 应用程序在这里运行良好,但无法访问 MachineA 的 WCF 服务并出现此类错误。
远程服务器返回错误:(401) Unauthorized.
堆栈跟踪 [MessageSecurityException:HTTP 请求未通过客户端身份验证方案“协商”进行授权。从服务器收到的身份验证标头是“协商,NTLM”。]
我尝试了很多东西,但都没有帮助。 请提供您的意见...
下面是客户端的 Web.Config
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
下面是服务器的 Web.Config
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
【问题讨论】:
标签: wcf authentication windows-authentication