我有 2 个 wcf 服务,它们都托管在同一台机器上的 IIS 上。
服务 A 由客户端调用并使用 BasicHttpBinding
与运输安全和 NTLM credentialtype
.
服务 A 需要调用同样托管在 IIS 上但使用 WsHttpBinding
的服务 B。与运输安全和 NTLM credentialtype
.
IIS 配置为使用集成的 Windows 身份验证。
第一次尝试我得到了 403 禁止消息 :
System.ServiceModel.Security.MessageSecurityException : The HTTP request was forbidden with client authentication scheme 'Ntlm'.
System.Net.WebException: The remote server returned an error: (403) Forbidden.
这是正常的,因为当我从服务 A 调用服务 B 时,使用了应用程序池的标识。
在我的第二次尝试中,我试图模拟对服务 B 的调用,但问题是操作中的所有代码都是在调用者帐户下执行的。此帐户在服务器上没有 ACL 权限,不能提供这些权限。
记录了以下错误:
System.IO.FileLoadException : Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
如何在不更改 ACL 或应用程序池标识的安全性的情况下解决此问题?
最佳答案
看一下这个:
http://blogs.msdn.com/b/securitytools/archive/2009/11/04/double-hop-windows-authentication-with-iis-hosted-wcf-service.aspx .
在这里找到了上面的链接:
http://go4answers.webhost4life.com/Example/calling-wcf-service-another-wcf-service-204170.aspx
关于wcf-security - 将凭证从一个 wcf 服务传递到另一个 wcf 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12097488/