我有一个SharePoint 2010服务应用程序,当我尝试在通道上执行某些代码时,我收到错误:
此上下文中不支持加密算法.System.NotSupportedException:此上下文中不支持加密算法。
实际上只有两个''引用,它们之间没有任何内容。我正在使用IssuedToken作为authenticationMode。这是我的web.config文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" defaultLanguage="C#" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="TLAPITypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="AF.TipAndLeadAPI.TipAndLeadAPIServiceApplication" behaviorConfiguration="TLAPITypeBehaviors">
<endpoint binding="customBinding" bindingConfiguration="TLAPIServiceHttpBinding"
contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract"
address="" />
</service>
</services>
<bindings>
<customBinding>
<binding name="TLAPIServiceHttpBinding">
<security authenticationMode="IssuedTokenOverTransport" allowInsecureTransport="true" />
<textMessageEncoding>
<readerQuotas maxStringContentLength="2048576000" maxArrayLength="2097152000" />
</textMessageEncoding>
<httpTransport maxReceivedMessageSize="2162688" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
<windowsAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</configuration>
我的client.config文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address=""
name="http"
binding="customBinding" bindingConfiguration="TLAPIServiceHttpBinding"
contract="AF.TipAndLeadAPI.ITipAndLeadAPIContract" />
</client>
<bindings>
<customBinding>
<binding name="TLAPIServiceHttpBinding">
<security authenticationMode="IssuedTokenOverTransport" allowInsecureTransport="true" />
<textMessageEncoding>
<readerQuotas maxStringContentLength="204857600" maxArrayLength="209715200" />
</textMessageEncoding>
<httpTransport maxReceivedMessageSize="216268800" authenticationScheme="Anonymous" useDefaultWebProxy="false" />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration>
当我将authenticationMode更改为IssuedTokenOverTransport之类的时候,我得到一个程序集不匹配错误。当我将其更改为任何带有证书的内容时,我会收到证书错误,因此我的猜测是,它与authenticationMode有关。
非常感谢任何帮助。