代码之家  ›  专栏  ›  技术社区  ›  Russell

WCF身份验证访问组

  •  1
  • Russell  · 技术社区  · 15 年前

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

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

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

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

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

    当ServiceA和ServiceB同时作为网络服务运行时,这很好地工作。

    如何允许ServiceBacessGroup的用户连接到ServiceB?

    编辑:有关环境的详细信息:

    .NET 3.5,IIS 7.0(was),通过NetTcpBinding,Windows Server 2008。

    编辑(2):是的,要求Tuzo的THX。这是客户端端点连接:

      <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 回复  |  直到 15 年前
        1
  •  2
  •   Randy Levy    15 年前

    尝试向服务配置添加标识元素:

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