Wcf 预期标识upn作为网络服务连接到服务,

Wcf 预期标识upn作为网络服务连接到服务,,wcf,authentication,spn,upn,Wcf,Authentication,Spn,Upn,我们有一个web应用程序,作为“网络服务”在应用程序池中运行。 web应用程序连接到另一个web服务器上的服务(.svc)。另一个web服务器也将该服务作为“网络服务”托管。我相信这是默认的 当在任何其他地方运行时,以下端点都能完美工作 <endpoint address="http://server123/UnitTrustService/UnitTrustService.svc" binding="wsHttpBinding" bindingConfiguration="WSHtt

我们有一个web应用程序,作为“网络服务”在应用程序池中运行。 web应用程序连接到另一个web服务器上的服务(.svc)。另一个web服务器也将该服务作为“网络服务”托管。我相信这是默认的

当在任何其他地方运行时,以下端点都能完美工作

<endpoint address="http://server123/UnitTrustService/UnitTrustService.svc"
  binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_UnitTrustService"
  contract="UnitTrustServiceReference.UnitTrustService" name="WSHttpBinding_UnitTrustService">
 <identity>
  <servicePrincipalName value="server123" />
 </identity>
</endpoint>
有什么想法吗? 我已经尝试过在web服务器机器上以完全相同的配置作为本地系统运行它,它工作得非常好

<endpoint address="http://server123/UnitTrustService/UnitTrustService.svc"
  binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_UnitTrustService"
  contract="UnitTrustServiceReference.UnitTrustService" name="WSHttpBinding_UnitTrustService">
 <identity>
  <servicePrincipalName value="server123" />
 </identity>
</endpoint>
这和IIS有关吗

问候
Craig.

这可能表明客户端的web.config存在问题。再次检查客户端的
。例如,如果服务希望标识为
userPrincipalName
而不是
servicePrincipalName
,则客户端web.config中的以下示例代码段可能会导致此异常。这是一个很容易错过的区别,我以前也曾这样做过

<system.serviceModel>
    <client>
      <endpoint address="http://server.domain.com/Services/DoSomething.svc" behaviorConfiguration="EndpointBehavior" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDoSomething" contract="Mycontract" name="WSHttpBinding_IDoSomething_Custom_AddSomething">
        <identity>
          <servicePrincipalName value="user@domain.com" />

是的,请看响应-它表示预期UPN。这是UserPrincipalName。将servicePrincipalName更改为userPrincipalName。您可以尝试的另一件事是将server.domain.com更改为IP地址,并查看这是否强制NTLM