Asp.net no se autentica en servicio WCF en el servidor 2008
-
20-08-2019 - |
Pregunta
Estoy teniendo un momento difícil la implementación de un sitio web de IIS 7 en Windows Server 2008. El sitio funciona bien hasta que trata de hacer llamadas a un servicio WCF alojado en el mismo host.
Todo funciona muy bien para el servicio de mi estación de trabajo cuando la banda se corrió en Visual Studio 20008 usando exactamente la misma web de configuración, etc. Tan pronto como Déployé la web en un directorio virtual en el servidor Bam. Errores de autenticación. También funciona como es cuando ambos se despliegan en un servidor Windows 2003. Qué que es diferente acerca Server 2008 que está causando esto? ¡AYUDA! Por favor.
En caso es importante, todas las operaciones de servicio requieren la pertenencia al grupo de Active Directory para el ASP.net página de usuario autenticado y están adornados como: [PrincipalPermission (SecurityAction.Demand, Papel = "SOAMemberShipService")]
Me sale el siguiente error de la página web:
La solicitud de token de seguridad no podía ser satisfecho porque ha fallado la autenticación. Descripción: Una excepción no controlada durante la ejecución de la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
Detalles de la excepción: System.ServiceModel.FaultException:. La solicitud de token de seguridad no podía ser satisfecho porque ha fallado la autenticación
Fuente de error:
Línea 919:
Línea 920: SearchMembers HSMembersService.MemberSearchResult pública (HSMembersService.MemberSearch MemberInfoToSearch) {
Línea 921: base.Channel.SearchMembers retorno (MemberInfoToSearch);
Línea 922:}
Línea 923:}
Fuente: C: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 \ Temporary ASP.NET Files \ csrweb \ a4d18657 \ a6d0910d \ App_WebReferences.jgx1svpr.0.cs Línea: 921
Seguimiento de la pila:
[FaultException:. La solicitud de token de seguridad no puede ser satisfecha debido a falla la autenticación] System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault (mensaje Mensaje, objetivo EndpointAddress) 6.375.432 System.ServiceModel.Security.IssuanceTokenProviderBase`1.ThrowIfFault (mensaje Mensaje, objetivo EndpointAddress) 25 System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody (Mensaje incomingMessage, SspiNegotiationTokenProviderState sspiState) 173
[SecurityNegotiationException:. La persona que llama no fue autenticado por el servicio] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (I-Mensaje reqMsg, I-Mensaje retMsg) 4.596.611 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData y MSGDATA, el tipo Int32) 1713 HSMembersService.IHSMembersService.SearchMembers (MemberSearch MemberInfoToSearch) 0 HSMembersService.HSMembersServiceClient.SearchMembers (MemberSearch MemberInfoToSearch) en c: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 \ Archivos temporales de ASP.NET \ csrweb \ a4d18657 \ a6d0910d \ App_WebReferences.jgx1svpr.0.cs: 921 _default.btnSearch_Click (remitente del objeto, EventArgs e) en e: \ CSRWeb \ default.aspx.cs: 114 System.Web.UI.WebControls.Button.OnClick (EventArgs e) 131 System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument) 140 System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler SourceControl, Cadena eventArgument) 39 System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 3215
web.config de sitio web ASP.net (porción relevante de servicio):
Servicios web.config:
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address ="" binding="wsHttpBinding" contract="HSMembersService.IHSMembersService" bindingConfiguration="wsHttpBindingConfig">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<!--<identity>
<dns value="localhost"/>
</identity>-->
</endpoint>
<!-- Metadata Endpoints -->
<!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
<!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBindingConfig" >
<security mode="Message">
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="HSMembersService.HSMembersServiceBehavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True" /><!-- Change this before deployment -->
</behavior>
</serviceBehaviors>
</behaviors>
Solución
De acuerdo, no hay respuestas aquí ni en los grupos de suscripción a MSDN.
Por lo tanto, he intentado todo. Y me refiero a todo. Después de lo que parecía ser varios días, pero en realidad era probablemente sólo 20 horas, funciona!
Todo lo que hice fue mover la ruta física de los archivos de servicios es decir, .dll, etc. .svc a un directorio fuera de mi c: root frente al wwwroot y funcionó. Tenía que actualizar mi directorio virtual para que apunte a él por supuesto.
¿Por qué esta ubicación causar un problema? Qué servidor IIS7.0 / Windows 2008 cambio de algo que no permite que los servicios que se desplegará desde una ubicación física de wwwroot? Probablemente nunca lo averiguaré porque nunca a tratar de implementar otro servicio de allí.
Me triple comprobado todos los permisos de la cuenta / directorio y los de la nueva ruta física son idénticos a los de la ruta física de edad por lo que no es bueno allí.
Si alguien se entera de por qué o sabe por qué. Por favor, hágamelo / nosotros sabemos.
Gracias,
Eddie
Otros consejos
Podría estar relacionado con este .