2014-06-24 1 views
9

현재 발행 된 토큰을 사용하여 .net 응용 프로그램과 서버 간 통신을 보호하기 위해 Thinktecture Identity Server 버전 2.4와 Windows Identity Foundation을 사용하고 있습니다.WIF (Thinktecture Identity Server 사용) 및 Duplex WCF 채널

페더레이션 된 끝점을 노출하고 채널 팩터 리의 "CreateChannelWithIssuedToken (SecurityToken)"메서드를 사용하여 문제 요청에서 반환 된 보안 토큰을 제공함으로써 표준 WCF NET TCP 채널을 통해 작업했습니다.

그러나 인스턴스 컨텍스트에서 전달할 수있는 DuplexChannelFactory에 대해 동일한 방법이없는 것처럼 보입니다. 이 기사에서는 http://msdn.microsoft.com/en-us/library/cc668765(v=vs.110).aspx을 읽었습니다.이 작업을 수행하기 위해 이중 바인딩을 만드는 방법을 자세히 설명했지만 채널을 만들 때 채널의 보안 토큰을 설정하는 방법을 알 수 없습니다.

클라이언트 자격 증명에는 IssuedToken 속성 - http://msdn.microsoft.com/en-us/library/system.servicemodel.description.clientcredentials.issuedtoken(v=vs.110).aspx이 있지만 읽기 전용입니다.

누군가 TCP 메시지 보안 모드를 사용하여 이중 채널에서 페더레이션 보안을 달성 한 사람이 있습니까?

답변

3

수동으로 채널을 만들고 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 자체는 인스턴스 컨텍스트를 통과하는 동안 발급 된 토큰이있는 채널을 만드는 방법을 제공하지 않습니다.

희망이 도움이됩니다.

관련 문제