2014-02-13 18 views
0

我偶然发现了一个很大的问题。服务器端在基于安全的传输级别上使用basicHttpBinding在.net上运行。所以在这里,我们去:2012 R2服务器中的WCF拒绝来自客户端凭据的基本http绑定

服务器的web.config(IIS基本身份验证= ON,所有其它=关,协议= HTTP):

<basicHttpBinding> 
     <binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed" messageEncoding="Text"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Basic" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 

在客户端,我们有相同的basicHttpBinding的。

App.exe.config:

<basicHttpBinding> 
    <binding name="Default" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" transferMode="StreamedResponse" maxBufferPoolSize="524288000" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="32" maxStringContentLength="65536000" maxArrayLength="65536000" maxBytesPerRead="2147483647" maxNameTableCharCount="16384"/> 
      <security mode="TransportCredentialOnly"> 
       <transport clientCredentialType="Basic" /> 
      </security> 
    </binding> 
</basicHttpBinding> 

而且,我碰巧知道在Windows 8.1和服务器2012 R2 basicHttpBinding的方法被限制转让的凭证。所以问题是我的选择是什么?我可以通过https避免使用SSL吗?如果不是,那么我的配置应该如何在两侧都使用wsHttpBinding来查找https?任何帮助赞赏!

回答

0

OK,你应该改变行:

<transport clientCredentialType="Basic" /> 

<transport clientCredentialType="Windows" /> 

使用传输安全机制与基本的HTTP绑定。 This link细节如何一步一步配置在这种情况下,IIS

+0

服务我的客户将需要下一个域,包括服务器,用于AD与Windows身份验证类型的工作。但我需要一个基本的认证方案。如果Windows身份验证发生更改,我可能会错误。 –

+1

这是correct.I猜你想使用类似的用户名和密码定制凭证。如果是这样的话,看看这个链接http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti –

相关问题