【问题标题】:expected identity upn connecting to service as network service,预期身份 upn 作为网络服务连接到服务,
【发布时间】:2010-05-27 12:06:08
【问题描述】:

我们有一个 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>

不幸的是,从网站执行时,我们收到以下错误。

        System.ServiceModel.Security.MessageSecurityException: 
    The identity check failed for the outgoing message. 
    The expected identity is 'identity(http://schemas.xmlsoap.org/ws/2005/05/identity/right/possessproperty: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn)' 
for the 'http://server123/UnitTrustService/UnitTrustService.svc' target endpoint. 
Server stack trace: at System.ServiceModel.Security.IdentityVerifier.EnsureIdentity(EndpointAddress serviceReference, AuthorizationContext authorizationContext, String errorString)...

有什么想法吗? 我已经尝试在具有完全相同配置的 Web 服务器机器上将其作为本地系统运行,并且运行良好。

跟IIS有关吗?

问候 克雷格。

【问题讨论】:

    标签: wcf authentication spn upn


    【解决方案1】:

    这可能表明 客户端的 web.config 存在问题。仔细检查客户端的&lt;identity&gt;。例如,如果服务期望标识为 userPrincipalName 而不是 servicePrincipalName,则客户端 web.config 中的以下示例 sn-p 可能会导致此异常。这是一个很容易错过的区别,它让我以前很着迷。

    <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。这是用户主体名称。将 servicePrincipalName 更改为 userPrincipalName。您可以尝试的另一件事是将 server.domain.com 更改为 IP 地址,看看这是否会强制 NTLM
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-23
    • 1970-01-01
    • 1970-01-01
    • 2011-12-26
    • 1970-01-01
    • 2014-01-14
    相关资源
    最近更新 更多