2011-05-13 4 views
2

HTTPS/SSL, 전송 보안 및 기본 인증을 사용하여 자체 호스팅 WCF 서비스를 만들었습니다. 어떤 이유로 브라우저에서 서비스를 실행할 때 자격 증명을 요청하지 않습니다. 뭐가 문제 야?WCF 자체 호스팅 서비스 SSL/전송 보안/기본 인증에서 자격 증명을 요청하지 않습니다.

서비스 구성 :

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.web> 
    <compilation debug="true" /> 
    </system.web> 
    <system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="WsHttpTest.GreetingServiceBehavior"> 
      <serviceMetadata httpsGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="TransportSecurity"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Basic"/> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="WsHttpTest.GreetingServiceBehavior" name="WsHttpTest.GreetingService"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="https://localhost:8555/WsHttpTest/Greeting" /> 
      </baseAddresses> 
     </host> 
     <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="WsHttpTest.IGreetingService" /> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    </system.serviceModel> 
</configuration> 

HTTP의 설정은 : 당신은 서비스 계약에 노출 된 작업을 프록시를 생성하고 호출 = 엔드 포인트와 통신하는 경우

C:\>httpcfg query ssl 
    IP      : 0.0.0.0:8555 
    Hash     : 14ae237add3c49 a5091367487563cf6f6a8f586 
    Guid     : {9416496a-6d3e-4680-a9d1-03defd97d7d6} 
    CertStoreName   : MY 
    CertCheckMode   : 0 
    RevocationFreshnessTime : 0 
    UrlRetrievalTimeout  : 0 
    SslCtlIdentifier  : 
    SslCtlStoreName   : 
    Flags     : 0 
------------------------------------------------------------------------------ 
C:\>httpcfg query urlacl 
    URL : https://localhost:8555/WsHttpTest/Greeting/ 
    ACL : D:(A;;GX;;;WD) 
------------------------------------------------------------------------------ 

답변

2

wsHttpBinding의 구성에만 사용됩니다. 서비스의 도움말 페이지를 열면 끝점과 통신하지 않습니다.

ServiceMetadataBehavior도 두 가지 추가 속성 인 HttpsHelpPageBindingHttpsHelpPageBindingConfiguration을 제공합니다. 아마도 이러한 속성을 가지고 놀고 일부 사용자 지정 바인딩 (사용자 지정이 필요하기 때문에 사용자 지정이어야합니다.)을 구성하면 도움말 페이지에 강제로 인증을 요구할 수는 있지만 결코 시도하지 않았을 것입니다.

내가 좋아하는 뭔가 시작할 것 :

<bindings> 
    <cutstomBinding> 
    <binding name="helpPage"> 
     <textMessageEncoding messageVersion="None" /> 
     <httpsTransport authenticationScheme="Basic" /> 
    </binding> 
    </customBinding> 
</bindings> 
관련 문제