WCF net.tcp 发行令牌。

6

有没有人有使用 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>

我一直收到“加密算法不受支持”的错误?使用ws2007FederationHttpBinding可以正常工作,但我需要使用net.tcp。有人能帮忙吗?


我已经尝试过了,但是使用 net.tcp 和 tokens 的自定义绑定没有任何结果。 - Fab
我有一个使用wsHttpBinding的令牌服务,但想要使用net.tcp将令牌传递给服务,因为我在防火墙后面。我了解其他绑定,但不熟悉net.tcp绑定,但我有一个下面工作的示例。 - Fab
1个回答

5

我通过设置allowInsecureTransport=true,得到了一个可用的版本。同时,我删除了secureconversation,因为我不需要会话。

<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>`

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接