【问题标题】:WCF Authentication Access GroupWCF 身份验证访问组
【发布时间】:2009-09-15 03:24:34
【问题描述】:

我有 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>

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

再次感谢!

【问题讨论】:

  • 您可以发布您的客户端(服务 A)配置吗?
  • 在编辑 3 中应该是“servicePrincipalName”,而不是“serviceProviderName”。

标签: wcf authentication active-directory


【解决方案1】:

尝试将身份元素添加到您的 ServiceA 配置中:

<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>

【讨论】:

  • 嗯,我知道你来自哪里,但是当我添加它时它没有工作。WCF 服务 A 已经在身份 ServiceUserA 下运行(在应用程序池中设置)所以这个值已经设置好了。
  • 将身份插入端点后,我收到了不同的异常。这是消息:“目标名称不正确或服务器已拒绝客户端凭据。”如何允许它连接到 ServiceB?注意:我不想使用 ServiceUserB 作为身份,因为我需要 ServiceA 使用自己的凭据进行连接。
  • 这是更新的配置: 仍然没有进行身份验证。有任何想法吗?提前致谢
猜你喜欢
  • 2010-11-17
  • 2011-08-18
  • 1970-01-01
  • 1970-01-01
  • 2011-11-27
  • 1970-01-01
相关资源
最近更新 更多