Аутентификация Kerberos с пользовательской привязкой WCF - PullRequest
0 голосов
/ 25 августа 2010

Я использую веб-сервис ASMX и создаю клиент WCF для сервиса с customBinding.В разделе безопасности customBinding я использую режим аутентификации как «KerberosOverTransport» и использую HTTP в качестве транспортного средства.См. Приведенный ниже код.

<customBinding>
    <binding name="Service1Soap" closeTimeout="00:01:00" openTimeout="00:01:00"
      receiveTimeout="00:10:00" sendTimeout="00:01:00">
      <security allowSerializedSigningTokenOnReply="true" authenticationMode="KerberosOverTransport"
        requireDerivedKeys="false" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
        messageSecurityVersion="Default" requireSecurityContextCancellation="false">
        <secureConversationBootstrap />
      </security>
      <textMessageEncoding messageVersion="Soap11" />
      <httpTransport authenticationScheme="Ntlm" unsafeConnectionNtlmAuthentication="false" />
    </binding>
  </customBinding>
</bindings>
<client>
  <endpoint address="http://localhost:1612/TestService.asmx" binding="customBinding"
    bindingConfiguration="Service1Soap" contract="WCFProxy.Service1Soap"
    name="Service1Soap" />
</client>

Когда я создаю экземпляр класса Proxy и вызываю метод Hello World веб-службы, я получаю следующее исключение.

"The CustomBinding'.' http://tempuri.org/' привязка для контракта 'Service1Soap'. 'Urn: Service1' настроена на режим аутентификации, который требует целостности и конфиденциальности на транспортном уровне. Однако транспорт не может обеспечить целостность и конфиденциальность. "

================================================================================================

в системе.ServiceModel.Dispatcher.SecurityValidationBehavior.SoapOverSecureTransportRequirementsRule.ValidateSecurityBinding (SecurityBindingElement SecurityBindingElement, Binding связывания, ContractDescription контракт) на System.ServiceModel.Dispatcher.SecurityValidationBehavior.ValidateSecurityBinding (SecurityBindingElement SBE, связывание связывания, ContractDescription контракта) на System.ServiceModel.Dispatcher.SecurityValidationBehavior.ValidateBinding (привязка привязки, контракт ContractDescription, SecurityBindingElement & securityBindingElement) в System.ServiceModel.Dispatcher.SecurityValidationBehavior.System.ServiceModel.Description.IEndpointBehavior.Validate (ServiceEndpoint servicelidServiceServiceService.Exception)isForService) в System.в System.ServiceModel.ClientBase 1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ClientBase 1.Open () в WCFClient.Program.Main (String [] args) в D: \ Rakesh \ Test Projects \ WebServiceCustomBinding \ WCFClient \ Program.cs: строка 16 в System.AppDomain._nExecuteAssembly (сборка сборки, аргументы String []) в System.AppDomain.ExecuteAssembly (сборка строк FileFile, доказательство assemblySecurity, String []args) в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly () в System.Threading.ThreadHelper.ThreadStart_Context (состояние объекта) в System.Threading.ExecutionContext.Run (обратный вызов executetionContext, ContextCallback, состояние объекта. состояние объекта) в системе).ThreadStart ()

Мне не повезло в поиске этого исключения.Прошло 2 дня с отделом исследований и разработок.Пожалуйста, предоставьте мне некоторую помощь по этому вопросу.Я буду очень рад вашей помощи!

С уважением, Ракеш.

Ответы [ 2 ]

0 голосов
/ 10 сентября 2013

Попробуйте вместо этого использовать <httpsTransport requireClientCertificate="true"/> обязательный элемент.

0 голосов
/ 25 августа 2010

Попробуйте вместо этого использовать BasicHttpBinding со следующей защитой:

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

Также вы можете проверить эту статью - есть часть о настройке клиента.

...