수동으로 채널을 만들고 STS로 직접 토큰을 발행하는 것은 잘못이 아니지만이를 위해 WIF 프레임 워크를 활용할 수 있습니다.
구성을 통해 클라이언트를 구성하여 STS를 인식하면 프레임 워크는 채널에 설정 한 메시지 자격 증명을 사용하여 토큰 자체를 검색합니다. 그런 다음 프레임 워크는 채널의 자격 증명에 "IssuedToken"속성을 설정합니다.
<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를 사용하여 이중 채널을 생성하는 방법을 보여줍니다.
이것의 장점 중 하나는 자신의 의존 URI를 설정할 수 있기 때문에 의존 당사자의 식별자로 WCF 끝점을 사용할 필요가 없다는 것입니다. (http://msdn.microsoft.com/en-us/library/cc668765(v=vs.110).aspx을 : 서비스 엔드 포인트를 설정
이
<behavior name="FederatedServiceBehaviour">
<clientCredentials useIdentityConfiguration="true" supportInteractive="false" >
<serviceCertificate/>
</clientCredentials>
</behavior>
여기에 설명되어 있습니다 :
또한 다음과 같이 WIF를 사용하려면 연합 서비스 동작을 설정해야합니다 (이것은에 WIF를 회전으로 useIdentityConfiguration 중요하다) degree)
DuplexChannelFactory 자체는 인스턴스 컨텍스트를 통과하는 동안 발급 된 토큰이있는 채널을 만드는 방법을 제공하지 않습니다.
희망이 도움이됩니다.