WCF身份验证访问组

时间:2009-09-15 03:24:35

标签: wcf authentication active-directory

我有2个WCF服务,(A和B),其中A调用B。

WCF服务A使用标识ServiceUserA(在应用程序池中设置)运行。 WCF服务B使用标识ServiceUserB(在应用程序池中设置)运行。

WCF服务B需要允许访问AD组ServiceBAccessGroup中的用户。 ServiceUserA是ServiceBAccessGroup的一部分。

当服务A尝试连接到服务B时,​​会出现此错误:

SecurityNegotiationException对SSPI的调用失败,请参阅内部异常: “目标主要名称不正确”

当ServiceA和Service B都作为网络服务运行时,这很好。

如何允许ServiceBAccessGroup的用户部分连接到ServiceB?

编辑:有关环境的更多信息:

.net 3.5,IIS 7.0(WAS),通过netTcpBinding,Windows Server 2008。

编辑(2):是的,请问Tuzo。这是客户端端点连接:

  <client>
      <endpoint address="net.tcp://MyServerName:812/v1_0/ServiceB.svc/ServiceB" binding="netTcpBinding" contract="IServiceB" name="ServiceBEndpoint" >
</endpoint>
 </client>

编辑(3):

感谢您的帮助,它使我更接近目标的方向。

我认为我的问题与授权而不是身份验证有关。我不想作为ServiceUserB进行身份验证,因为这会破坏我们的安全模型的目的。

使用以下方法确实有效:

<identity>
  <serviceProviderName value="ServiceB/MyServerName:812" />
</identity>

我会给你正确答案,因为它确实是正确的,并帮助我到达目的地。

再次感谢!

1 个答案:

答案 0 :(得分:2)

尝试在ServiceS配置中添加标识元素:

<client>
  <endpoint address="net.tcp://MyServerName:812/v1_0/ServiceB.svc/ServiceB" binding="netTcpBinding" contract="IServiceB" name="ServiceBEndpoint" >
      <identity>
          <userPrincipalName value="user@domain" />
      </identity>
  </endpoint>
</client>