2015-11-02 67 views
6

有沒有人有當前使用net.tcp與發佈令牌的消息安全模式的示例。我目前有一個安全令牌服務發出令牌,但不知道如何使用net.tcp進行配置。我只看到使用示例ws2007FederationHttpBindingWCF net.tcp頒發的令牌

<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。任何人?

+0

我做了,但沒有與自定義綁定使用net.tcp與標記。 – Fab

+0

我有一個使用wsHttpBinding的令牌服務,但由於我在防火牆後面,所以想使用帶有net.tcp的服務令牌。我瞭解其他綁定,但不是net.tcp綁定熟悉,但我有一個示例工作如下。 – Fab

回答

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