BasicHttpBinding with TransportWithMessageCredential and clientCredentialType=“Windows”

那年仲夏 提交于 2019-12-09 20:02:28

问题


I am using this binding configuration on client and server:

<basicHttpBinding>
    <binding name="BasicHttpBinding_IService1">
        <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Windows" />
        </security>
    </binding>
</basicHttpBinding>

The client credentials seem to not be passed automagically (or are they?) this way like i assumed, so i need to know how to set them by myself. Will this even work?


回答1:


You have to enable Windows Authentication on IIS. Look at the below link for how to do it.

Also, I checked the MSDN web site, the key difference between your config and at msdn is security mode

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

The only difference is mode as you can see. I am not sure this would solve your problem but give it a go.

Below are the 5 possible “Security Modes” across all “Service Bindings”.

None - Turns security off.

Transport - Uses “Transport security” for mutual authentication and message protection.

Message - Uses “Message security” for mutual authentication and message protection.

Both - Allows you to supply settings for transport and message-level security (only MSMQ supports this).

TransportWithMessageCredential - Credentials are passed with the message and message protection and server authentication are provided by the transport layer.

TransportCredentialOnly - Client credentials are passed with the transport layer and no message protection is applied.




回答2:


I have found out the reason for this behavior was a faulty ASP.NET 4 installation which i had to reenabled. After that it "just worked".

http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx



来源:https://stackoverflow.com/questions/11502165/basichttpbinding-with-transportwithmessagecredential-and-clientcredentialtype-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!