2011-10-20 2 views
2

WCF 서비스가 Windows 서비스에서 호스팅되고 있으며 Windows Forms 응용 프로그램에서 호출되고 있습니다. Windows 인증 및 가장을 사용하고 있습니다. 명의 도용이 작동 중입니다. 그러나 Integrated Security를 ​​사용하여 SQL Server에 액세스하려고하면 "Login failed for user"가 표시됩니다. ". 콘솔 응용 프로그램 내에서 서비스를 호스팅 할 때도 동일한 결과가 나타납니다. SQL 보안을 사용하면 모든 것이 제대로 작동합니다.WCF 서비스 내에서 가장을 사용할 때 SQL 로그인이 실패 함

다음은 서비스에 대한 설정 파일입니다.

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="WSHttpBinding_IService"> 
     <security mode="Message"> 
     <transport clientCredentialType="Windows" 
        proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="Windows" 
       negotiateServiceCredential="true" 
       algorithmSuite="Default" 
       establishSecurityContext="true" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="ServiceBehavior"> 
    <serviceMetadata httpGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="false" /> 
    <serviceAuthorization impersonateCallerForAllOperations="true" /> 
    </behavior> 
    </serviceBehaviors> 
    <serviceBehaviors> 
    <behavior name="DefaultBehavior"> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<services> 
    <service behaviorConfiguration="ServiceBehavior" name="AfsNetService"> 
    <endpoint address="" binding="wsHttpBinding" contract="IAfsNetService"> 
     <identity> 
     <userPrincipalName value="[email protected]" /> 
     <servicePrincipalName value="localhost" /> 
     <!--<dns value="" />--> 
     </identity> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 

감사의 말을 전합니다.

답변

1

이는 WCF의 문제가 아니라 네트워크에있는 컴퓨터 사이에 인증이 발생하는 방법의 근본적인 결과가 아닙니다. classic "double hop" authentication issue입니다. 모든 인증이 Kerberos를 사용하고 위임이 특별히 구성되어 있지 않으면 서비스를 호스팅하는 서버와 데이터베이스 서버간에 두 번째 홉의 위임 된 인증이 일반적으로 불가능합니다.

이 시나리오는 관련된 모든 컴퓨터 (즉, WinForms 앱이 실행되는 워크 스테이션, 서비스를 호스팅하는 서버 및 데이터베이스 서버)가 모두 Kerberos 인증을 지원하고 NTLM으로 폴백하지 않는 경우에만 작동합니다. 모든 인증이 Kerberos를 사용하고 있는지 확인하는 경우

는, 당신은 그 대표가 올바르게 구성되어 있는지 확인해야합니다. This checklist이 도움이 될 수 있지만, 일부는 IIS가 중간 계층 서버라는 것과 관련이 있습니다.

1

이것이 문제를 해결할 수 있는지 확실하지 않지만 xml 구성에 bindingConfiguration 태그가없는 것 같습니다. 나는 그것이해야한다고 생각 같은 :

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"/> 
관련 문제