2011-09-12 7 views
1

Windows 서비스에서 호스팅되는 WCF 서비스에 기본 인증을 추가하려면 어떻게합니까?WCF에 기본 인증 추가 Windows 서비스에서 호스팅되는 서비스

내 바인딩에 보안 태그를 추가했지만 브라우저에서 서비스 URL을 호출 할 때 인증 창이 표시되지 않습니다. 내가 뭘 잘못하고/내가 무엇을 놓치고 있습니까?

<bindings> 
    <basicHttpBinding> 
    <binding name="MyDefaultBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000"> 
     <readerQuotas maxDepth="500" maxArrayLength="20000000" maxStringContentLength="20000000"/> 
    <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Basic" /> 
    </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

답변

4

서비스 도우미 페이지에 액세스 할 때 인증 창이 표시되지 않습니다. 인증은 서비스 엔드 포인트에 대해 구성되며, 도우미 페이지 또는 WSDL ("개별 엔드 포인트")이 아닙니다.

<bindings> 
    <customBinding> 
    <binding name="securedPages"> 
     <textMessageEncoding messageVersion="None" /> 
     <httpsTransport authenticationScheme="Basic" /> 
    </binding> 
    <customBinding> 
    <basicHttpBinding> 
    <binding name="MyDefaultBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000"> 
     <readerQuotas maxDepth="500" maxArrayLength="20000000" maxStringContentLength="20000000"/> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Basic" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="securedService"> 
     <serviceMetadata httpGetEnabled="true" httpGetBinding="customBinding" 
         httpGetBindingConfiguration="securedPages" /> 
     <serviceDebug httpHelpPageEnabled="true" httpHelpPageBinding="customBinding" 
        httpHelpPageBindingConfiguration="securedPages" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<services> 
    <service name="..." behaviorConfiguration="securedService"> 
    ... 
    </service> 
</services> 
:

봅니다 구성을 수정하는 방법

관련 문제