2012-04-30 112 views
2

我目前使用netTcpBinding与Windows身份验证(用C#编写的程序)。我将远离域身份验证(添加不在域中的新客户端),并希望通过用户名/密码身份验证设置证书安全性。从我到目前为止阅读的内容来看,我不一定需要客户端证书(这很好,我不能在每个客户端上安装该服务的证书)。我的想法与使用来自可信CA的证书导航到安全网站的思路是一致的;它承认它是值得信赖的,不会提出任何问题或给予任何麻烦,它只是接受证书!WCF证书身份验证仅服务(无客户端证书)

到目前为止,我已经设置了服务证书(我们有一个来自GoDaddy的通配证书),但是我无法弄清楚我必须对app.config文件做出什么修改来不需要客户端证书。

服务的app.config:

<serviceBehaviors> 
    <behavior name=""> 
    <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" /> 
    <serviceDebug includeExceptionDetailInFaults="false" /> 
    <serviceCredentials> 
     <clientCertificate> 
     <authentication certificateValidationMode="None" revocationMode="NoCheck" /> 
     </clientCertificate> 
     <serviceCertificate findValue="*.xxxxxx.com" 
          storeLocation="LocalMachine" 
          storeName="TrustedPublisher" 
          x509FindType="FindBySubjectName" /> 
    </serviceCredentials> 
    </behavior> 
</serviceBehaviors> 

客户端的app.config:

 <security mode="Transport"> 
     <transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign" /> 
     <message clientCredentialType="UserName" /> 
     </security> 

我知道我必须设立用户名部分的自定义验证,但我想一步一步来。谢谢,让我知道你是否需要进一步的细节。

回答

3

将clientCredentialType更改为None。在服务器配置上也要这样做。

+1

谢谢,我会试一试,让你知道它是如何工作的! – jmgardn2

+1

工作完美!感谢您的帮助! – jmgardn2

相关问题