2011-05-13 4 views
1

도메인의 Windows 2008/IIS 7.5에서 실행되는 테스트 WCF 4 서비스가 있습니다.wcf 4/iis/server 2008 windows 인증 이상

바인딩에서 Windows 인증을 사용하고 있습니다. 나는 .NET 윈도우 클라이언트에서이 서비스에 액세스 할 때

는 :

tsc.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; 

경우 :

tsc.ChannelFactory.Credentials.Windows.ClientCredential = new NetworkCredential("bob.jones", "password", "DOMAIN"); 

그것은 내가 사용하는 경우 실패 : 내가 사용하는 경우

var b = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly); 
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; 
EndpointAddress a = new EndpointAddress("http://server/TestService.svc"); 
TestServiceClient tsc = new TestServiceClient(b, a);         

그것은 작동 그것은 내가 Fiddler에서 401을 참조하십시오 : "401 - 권한이 : 잘못된 자격 증명으로 인해 액세스가 거부되었습니다. "

성공 나는 같은 401을 본 다음 200을 볼 수 있으며 요청 및 응답에서 kerboros 티켓을 볼 수 있습니다.

가 여기 내 서비스 설정입니다 :

<system.serviceModel> 

<bindings> 
    <basicHttpBinding> 
    <binding> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Windows" proxyCredentialType="Windows"/> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 

답변

1

다른 사람이 관심이없는 것 같다 것을보고, 나는이 나 자신에 대답해야합니다 같아요.

이 문제에 대한 많은 작은 부분이 있었다, 그러나 나는 단지 내가 뭘 찾았는지의 개요주지 :

  1. 나는 "협상 : Kerberos를"공급자를 사용했다 "협상"을하지.

    SETSPN -A HTTP/서버 이름 : 포트 도메인 \ 사용자 이름

    SETSPN -A

  2. 은 내가 응용 프로그램 풀에 사용 된 도메인 계정의 서버 원칙 이름 (SPN)를 구성했다 HTTP/FQDN : 포트 도메인 \ 사용자

  3. 나는 클라이언트 앱이 정확한 BasicHttpSecurityMode.TransportCredentialOnly 및 ClientCredentialType = HttpClientCredentialType.Windows를 지정하지 않은 다른 서비스, 나중에 눈치 또 다른 점은, 다른 클라이언트 머신이 "필요한 것이 었습니다 협상 "및 기타 rs required "협상 : Kerberos". 내가 아직 제어 할 수 있는지 알지 못했습니다.