हालांकि मैन्युअल रूप से चैनल बनाना और एसटीएस के साथ खुद को टोकन जारी करना गलत नहीं है, तो आप यह करने के लिए डब्ल्यूआईएफ ढांचे का लाभ उठा सकते हैं।
यदि आप एसटीएस के बारे में जागरूक होने के लिए कॉन्फ़िगरेशन के माध्यम से अपने क्लाइंट को कॉन्फ़िगर करते हैं, तो फ्रेमवर्क आपके द्वारा सेट किए गए संदेश प्रमाण-पत्रों का उपयोग करके टोकन को पुनर्प्राप्त करेगा। फ्रेमवर्क तब चैनल के प्रमाण-पत्रों पर "जारी किए गए" संपत्ति को सेट करेगा।
<ws2007HttpBinding>
<binding name="ws">
<security mode="TransportWithMessageCredential">
<message establishSecurityContext="false"
negotiateServiceCredential="true"
clientCredentialType="UserName" />
</security>
</binding>
</ws2007HttpBinding>
<customBinding>
<binding name="FederationDuplexTcpMessageSecurityBinding">
<reliableSession />
<security authenticationMode="SecureConversation">
<secureConversationBootstrap authenticationMode="IssuedTokenForSslNegotiated">
<issuedTokenParameters>
<issuer address="https://IdentityServer.domain/issue/wstrust/mixed/username" binding="ws2007HttpBinding" bindingConfiguration="ws" />
<issuerMetadata address="https://IdentityServer.domain/issue/wstrust/mex" />
<additionalRequestParameters>
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
<Address>RelyingParty.com</Address>
</EndpointReference>
</wsp:AppliesTo>
</additionalRequestParameters>
</issuedTokenParameters>
</secureConversationBootstrap>
</security>
<tcpTransport />
</binding>
</customBinding>
ऊपर कोड स्निपेट दिखाता है कि आप एक सुरक्षित बातचीत और एक secureConversationBootstrap का उपयोग कर फ़ेडरेटेड सुरक्षा का ख्याल रखना एक डुप्लेक्स चैनल बना सकते हैं।
इसका एक फायदा यह है कि आप अपनी खुद की भरोसेमंद पार्टी यूआरआई भी सेट कर सकते हैं, इसलिए आपको डब्ल्यूसीएफ एंडपॉइंट को अपने भरोसेमंद पार्टी के पहचानकर्ता के रूप में उपयोग करने की आवश्यकता नहीं है।
तुम भी इस प्रकार WIF सक्षम करने के लिए संघीय सेवा व्यवहार स्थापित करने के लिए की आवश्यकता होगी (useIdentityConfiguration महत्वपूर्ण है, के रूप में यह पर WIF बदल जाता है):
<behavior name="FederatedServiceBehaviour">
<clientCredentials useIdentityConfiguration="true" supportInteractive="false" >
<serviceCertificate/>
</clientCredentials>
</behavior>
सेवा समाप्ति बिंदु की स्थापना यहाँ प्रलेखित है: http://msdn.microsoft.com/en-us/library/cc668765(v=vs.110).aspx (एक डिग्री के लिए)
जहां तक मैं देख सकता हूं कि डुप्लेक्सChannelFactory खुद को संदर्भ संदर्भ के माध्यम से जारी किए गए टोकन के साथ चैनल बनाने के लिए कोई विधि नहीं दिखाता है।
आशा है कि इससे मदद मिलती है!