WCF net.tcp发出令牌

时间:2015-11-02 16:37:07

标签: wcf wif

是否有人使用net.tcp和已发布令牌的邮件安全模式的当前示例。我目前有一个安全令牌服务,它发出令牌,但不知道如何使用net.tcp配置它。我只看到使用ws2007FederationHttpBinding

的例子
<customBinding>
    <binding name="wsFed">
      <security authenticationMode="SecureConversation" requireSecurityContextCancellation="true">

        <secureConversationBootstrap authenticationMode="IssuedToken">

          <issuedTokenParameters tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1">
            <issuer address="http://localhost/STSWebHost/STSService.svc" binding="ws2007HttpBinding" />
          </issuedTokenParameters>

        </secureConversationBootstrap>
      </security>


      <tcpTransport />

    </binding>
  </customBinding>

我一直得到Crypto算法不支持错误?使用ws2007FederationHttpBinding工作正常,但我需要使用net.tcp。任何人吗?

1 个答案:

答案 0 :(得分:5)

通过设置allowInsecureTransport = true,我有一个工作版本。我也删除了安全对话,因为我不想要会话。

<customBinding>
    <binding
     name="netTcpFederated">
      <security
        authenticationMode="IssuedTokenOverTransport"
        allowInsecureTransport="true" >

        <issuedTokenParameters keyType="BearerKey" />

      </security>

      <binaryMessageEncoding>
        <readerQuotas
          maxStringContentLength="1048576"
          maxArrayLength="2097152" />
      </binaryMessageEncoding>

      <tcpTransport
        maxReceivedMessageSize="2162688" />
    </binding>

   </customBinding>`