WCF:令牌提供程序无法获取目标令牌 [英] WCF : The token provider cannot get tokens for target

查看:73
本文介绍了WCF:令牌提供程序无法获取目标令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



对不起,我不是Webservices的专家,但我会尽可能完整地解释我的问题。



我们有一个Web服务,在数据库和客户站点上托管的应用程序之间进行通信。 Web服务从客户端获取执行应用程序所需的一些数据。



不幸的是,我们在每次执行应用程序时都收到错误消息,< b>但只是偶尔。



错误信息是:



Hello,

Sorry, I'm not specialist in Webservices but I'll try to explain my problem as fully as possible.

We have a webservice communicating between a database and an application hosted at the customer site. The webservice get back some data needed for the execution of the application from the customer side.

Unfortunately, we get an error message not at each execution of the application, but only once in a while.

The error message is :

[1] ERROR System.ServiceModel.Security.SecurityNegotiationException [(null)] - System.ServiceModel.Security.SecurityNegotiationException: The token provider cannot get tokens for target  «  ». ---> System.ServiceModel.Security.SecurityNegotiationException: Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint..  ---> System.ServiceModel.FaultException: The request for security token has invalid or malformed elements.<br />
<br />
   à System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)<br />
<br />
   à System.ServiceModel.Security.IssuanceTokenProviderBase`1.ThrowIfFault(Message message, EndpointAddress target)<br />
<br />
   à System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)<br />
<br />
   --- Fin de la trace de la pile d'exception interne ---<br />
<br />
   à System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)<br />
<br />
   à System.ServiceModel.Security.IssuanceTokenProviderBase`1.GetTokenCore(TimeSpan timeout)<br />
<br />
   à System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)<br />
<br />
   à System.ServiceModel.Security.SecurityProtocol.GetToken(SecurityTokenProvider provider, EndpointAddress target, TimeSpan timeout)<br />
<br />
   --- Fin de la trace de la pile d'exception interne ---





网络服务端的配置是:





The configuration from the webservice side is :

<bindings>
<wsHttpBinding>
<binding name="wsHttpBindingConfiguration" closeTimeout="10:01:00" openTimeout="10:01:00"

receiveTimeout="10:01:00" sendTimeout="10:01:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="Message">
<message clientCredentialType="None" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
</bindings>





来自客户端的配置是:





The configuration from the client side is :

<wsHttpBinding>
<binding name="wsHttpBindingConfiguration" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Message">
<message clientCredentialType="None" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
</bindings>





你能帮我这个吗?



提前致谢,


$ b $bCéline



Can you help me with this?

Thanks in advance,

Céline

推荐答案

修改你的代码如下。



Modify your code as follows.

<security mode="Message">
     <message algorithmsuite="TripleDesSha256Rsa15">
              clientCredentialType="Windows"
              establishSecurityContext="false"
              negotiateServiceCredential="true"/>
</message></security>


这篇关于WCF:令牌提供程序无法获取目标令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆