2011-11-10 5 views
2

그래서 여러 표준 끝점 (도움말 기능 용)을 사용하기 위해 WCF 4 REST 응용 프로그램을 구성하려고합니다. 그 이유는 내 호스팅 IIS 프로세스 익명 및 Windows 인증을 모두 사용할 수 있으며 내 WCF 응용 프로그램 내 특정 끝점을 필요로 하나 또는 다른 (둘 다 예외의 결과).WCF 4 REST - 인증을위한 다중 표준 끝점

<bindings> 
    <webHttpBinding> 
    <binding name="Anonymous"> 
     <security mode="None" /> 
    </binding> 

    <binding name="WindowsAuthentication"> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Windows" /> 
     </security> 
    </binding> 
    </webHttpBinding> 
</bindings> 

그리고 다음과 같이 서비스를 정의 :

이전에, 내가 어떤 바인딩을 정의하여이 작업을 수행 할 수 있었다

<services> 
    <service name="Host.SubscriberInfoHost"> 
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="WindowsAuthentication" contract="Host.ISubscriberInfoHost" /> 
    </service> 
    <service name="Utilities.Instrumentation.ServiceStatus.ServiceStatusHost"> 
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="Anonymous" contract="Utilities.Instrumentation.ServiceStatus.IServiceStatusHost" /> 
    </service> 
</services> 

이것은 내가 지금까지 할 시도한 것입니다 표준 엔드 포인트 모델을 사용하는 동안 :

<standardEndpoints> 
     <webHttpEndpoint> 
      <standardEndpoint name="Host.SubscriberInfoHost" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
       <security mode="TransportCredentialOnly"> 
       <transport clientCredentialType="Windows" /> 
       </security> 
      </standardEndpoint> 

      <standardEndpoint name="Utilities.Instrumentation.ServiceStatus.IServiceStatusHost" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
       <security mode="None" /> 
      </standardEndpoint> 
     </webHttpEndpoint> 
    </standardEndpoints> 

그러나이 서비스를 얻는 일을하는 것은 내가로 혼란 수신 :

System.InvalidOperationException: IIS specified authentication schemes 'Negotiate, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used 

정확히 어느 것에서 벗어나려고합니다. 누군가가 새로운 표준 엔드 포인트 모델을 사용하여이 상황을 설정하는 방법에 대해 저에게 줄 수 있습니까? 감사!

답변

2

일부 실험 후에 이에 대한 답변을 찾았습니다. 표준 엔드 포인트의 "이름"속성은 실제로 엔드 포인트 구성임을 알 수 있습니다. 그래서, 당신은 다음과 같은 표준 엔드 포인트를 사용합니다 :

<standardEndpoint name="WindowsAuthentication" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" /> 
      </security> 
</standardEndpoint> 

<standardEndpoint name="Anonymous" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
      <security mode="None" /> 
</standardEndpoint> 

그 다음을, 당신은 또한 같은 서비스를 구성 할 것 (이하 "종류"와 "endpointConfiguration"에이 엔드 포인트 넥타이하기 위해 설정해야합니다 속성 다음

<service name="SomeEndpoint"> 
    <endpoint address="" kind="webHttpEndpoint" endpointConfiguration="WindowsAuthentication" contract="ISomeEndpoint" /> 
    </service> 

이렇게하면 편리한 서비스 도움말 페이지를 유지하면서 인증 스타일을 혼합 할 수 있습니다.

+0

알고있는 한 서비스는 하나의 인증 모드 만 사용할 수 있습니다. 이게 효과가 있었나요? –

+0

이것은 저에게 효과적이었습니다. 지금이 나이였던 것 같아서 .NET 3.5를 믿습니다. –