【发布时间】:2012-08-19 07:33:17
【问题描述】:
我有 2 个 wcf 服务都托管在同一台机器上的 IIS 上。
服务 A 由客户端调用,并使用 BasicHttpBinding 与传输安全和 NTLM credentialtype。
服务 A 需要调用同样托管在 IIS 上的服务 B,但使用具有传输安全性的 WsHttpBinding 和 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 或应用程序池身份的安全性的情况下解决此问题?
【问题讨论】:
标签: wcf-security impersonation