Windows 자격 증명이없는 nettcpbinding?
-
11-07-2019 - |
문제
단일 클라이언트 컴퓨터와 기계 서브넷에 통신하는 5 개의 서버 상자가있는 머신 제어 응용 프로그램이 있습니다. 도메인 컨트롤러가 없습니다. 사용하고 싶습니다 nettcpbinding 신뢰성 및 거래 지원을 허용합니다.
도메인 컨트롤러가 없을 때이 바인딩과 함께 사용자 이름 / 비밀번호 인증을 사용할 수 있습니까? Office LAN에 연결되지 않은 900 대의 컴퓨터 (150 대의 기계)에서 인증서를 관리하고 싶지 않으므로 인증서를 사용하지 않기를 원합니다.
해결책
예, 물론 - 전송 보안이 아닌 메시지 보안을 사용하는 경우에만. 바인딩 구성을 정의하십시오.
<netTcpBinding>
<binding name="UserNameSecurity">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</netTcpBinding>
그런 다음 엔드 포인트 (서버 및 클라이언트)의 바인딩 구성을 참조하십시오.
<endpoint address="....."
binding="netTcpBinding"
bindingConfiguration="UserNameSecurity"
contract="IMyService" />
마크
업데이트:
아, 그렇습니다. 서버 측에서는 고객에게 서비스를 인증하려면 인증서가 필요하며 메시지를 암호화하는 데 사용됩니다. 서버에만 해당됩니다. 클라이언트는 아무것도 설치할 필요가 없습니다.
구성:
<behaviors>
<serviceBehavior>
<behavior name="ServerInternet">
<serviceCredentials>
<serviceCertificate
findValue="MyServiceCertificate"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName" />
</serviceCredentials>
</behavior>
</serviceBehavior>
</behaviors>
<services>
<service name="MyServiceInternet"
behaviorConfiguration="ServerInternet">
....
</service>
</services>
서버의 인증서를 구성에 지정할 "제목 이름"아래 서버의 "로컬 머신"폴더에 설치하십시오.
다른 팁
먼저 시도해 볼 수있는 것이 있습니다. ServiceneGotiationCredentials를 true로 설정하십시오.
<message negotiateServiceCredential="true"/>
이렇게하면 도메인 컨트롤러없이 클라이언트와 서비스간에 안전한 대화가 나옵니다.
그러나 도메인 컨트롤러가 없으면 클라이언트가 귀하의 서비스를 신뢰하지 않으므로 실패합니다.
따라서 예상을 설정해야합니다 서비스의 신원. 서비스의 WSDL에서 찾을 수 있습니다. 기본적으로 IIS에서 호스팅되는 경우 다음과 같은 것 같습니다.
<client>
<endpoint>
<identity>
<servicePrincipalName value="host/NETWORKSERVICE"></servicePrincipalName>
</identity>
</endpoint>
</client>
필요하지 않다고 생각하지만 서비스 측면에서 익명 로그온을 허용해야 할 수도 있습니다.
<serviceBehaviors>
<behavior>
<serviceCredentials>
<windowsAuthentication allowAnonymousLogons="true"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>