2010-05-27 3 views
4

Nous avons une application Web qui s'exécute dans un pool d'applications en tant que 'SERVICE RÉSEAU'. L'application Web se connecte à un service (.svc) sur un autre serveur Web. L'autre serveur Web a également le service hébergé en tant que «SERVICE RÉSEAU». Je crois que c'est le défaut.Identité attendue upn se connectant au service en tant que service réseau,

Le point de terminaison suivant, lorsqu'il est exécuté ailleurs, fonctionne parfaitement. Malheureusement, lors de l'exécution à partir du site Web, nous obtenons l'erreur suivante:

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

Des idées? J'ai essayé d'exécuter ceci comme système local sur la machine du serveur Web avec exactement la même configuration et cela fonctionne parfaitement.

Cela a quelque chose à voir avec IIS?

Cordialement Craig.

Répondre

4

Ceci indique probablement un problème avec le fichier web.config du client. Vérifiez le <identity> pour le client. Par exemple, l'exemple de fragment suivant dans web.config de votre client peut provoquer cette exception si le service s'attendait à ce que l'identité soit userPrincipalName au lieu de servicePrincipalName. C'est une distinction facile à manquer qui m'a rattrapé avant.

<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="[email protected]" /> 
+0

oui, regardez la réponse - il est dit qu'il attendait UPN. C'est le UserPrincipalName. remplacez servicePrincipalName par userPrincipalName. Une autre chose que vous pouvez essayer est de changer le server.domain.com en adresse IP et voir si cela force NTLM – Sentinel

Questions connexes