2012-04-18 3 views
0

Azure 서비스 버스 중계를 사용하여 회사 네트워크 외부의 사용자에게 WCF 서비스를 제공하려고합니다.app.config 파일에서 NetTcpRelaySecurity 요소를 사용하려면 어떻게해야합니까?

나는 어느 정도 성공했지만, 통신이 작동한다는 것을 증명하기 위해 WCF 서비스에 구현 된 모든 사용자 지정 사용자 이름과 암호 인증을 제거해야했습니다.

(이 네트워크 내에서 어떤 클라이언트와 서비스를 사용하기 때문에) 전송에서 TransportWithMessageCredential에 - 나는 인터넷 검색을하고 잠시 동안 주제에 읽고있다

내가 변경해야 어디 NetTcpRelaySecurity 모드이라고 생각

그래서 구성 파일에서이 설정을 어떻게 변경합니까? 지금까지 예제를 찾을 수 없습니다.

나는 올바른 방향으로 가고 있습니까? 외부 클라이언트 응용 프로그램의 사용자 이름과 암호 클라이언트 자격 증명을 서비스 버스를 통해 WCF 서비스로 전달할 수 있습니까?

답변

0

바로 거기에 샘플 구성이 많지 않습니다. 다음은 구성을 시도 할 수있는 방법입니다.

NetTcpRelayBindingConstructor 는 NetTcpRelayBinding 생성자 (EndToEndSecurityMode, RelayClientAuthenticationType)는

EndToEndSecurityMode 다음 열거있다.

Member name Description 
None  Security is disabled. 
Transport Security is provided using a transport security, typically SSL. 
Message  Security is provided using SOAP message security. 
TransportWithMessageCredential  A secure transport (for example, HTTPS) provides integrity, confidentiality, and authentication while SOAP message security provides client authentication. 

RelayClientAuthentication은 이하의 열거를 갖는다.

Member name   Description 
    RelayAccessToken If specified by a listener, the client is required to provide a security token. 
    None    If specified by a listener, the client will not be required to provide a security token. This represents an opt-out mechanism with which listeners can waive the Access Control protection on the endpoint. 

내가 본 가장 가까운 구성 예이다 -
http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.nettcprelaybinding.aspx

다음
<bindings> 
    <!-- Application Binding --> 
    <netTcpRelayBinding> 
     <binding name="customBinding"> 
     <!-- Turn off client authentication --> 
     <security relayClientAuthenticationType="None" /> 
    </netTcpRelayBinding> 
    </bindings> 

당신이 사용할 수있는 예제 :

<bindings> 
    <!-- Application Binding --> 
    <netTcpRelayBinding> 
     <binding name="customBinding"> 
     <!-- Turn off client authentication --> 
     <security endToEndSecurityMode=”TransportWithMessageCredential” relayClientAuthenticationType="None" /> 
    </netTcpRelayBinding> 
    </bindings> 

을하지만, 당신은 확인해야 Service Bus 바인딩 확장 요소는이를 사용하기 위해 machine.config 또는 응용 프로그램 구성 파일에 추가됩니다. 그렇지 않은 경우, 어떤 경우 에든 비주얼 스튜디오가 오류를 던질 것입니다.

클라이언트에서 서비스로의 종단 간 보안은 서비스 버스에 특정한 것이 아니라 표준 WCF입니다. SB가 필요로하는 것은 relayClientAuthenticationType입니다.

<security mode="" relayClientAuthenticationType="RelayAccessToken"> 

nettcprelaybinding에 대한 보안 설정은 nettcpbinding과 유사해야합니다. nettcpbinding 샘플을 시작점으로 사용할 수 있습니다.

+0

응답 해 주셔서 감사합니다. 귀하의 예를 시도하고 "endToEndSecurityMode"가 인식 할 수없는 속성이라는 오류가 발생했습니다. Microsoft.ServiceBus에 대한 참조를 추가 할 때 자동으로 생성되는 서비스 버스 바인딩 확장 요소가있어 netTcpRelayBinding이 오류를 일으키지는 않지만 추가 요소를 추가해야 할 필요가 있습니까? – Lewray

관련 문제