在跟随几篇MSDN文章后,我让客户端证书和用户名密码用于我的WCF服务。客户端需要证书和用户名密码才能访问我的服务。
最近,证书停止工作了,我可以在不提供客户端证书的情况下访问服务。我正在使用SOAP UI测试客户端。通常我需要将客户端证书添加到密钥库中,然后指定哪个密钥用于请求。
最近我设置了一个测试,我不必提供客户端证书。我的配置没有改变,这是正确的设置吗?
谢谢。
我的绑定配置:
行为表现:
最近,证书停止工作了,我可以在不提供客户端证书的情况下访问服务。我正在使用SOAP UI测试客户端。通常我需要将客户端证书添加到密钥库中,然后指定哪个密钥用于请求。
最近我设置了一个测试,我不必提供客户端证书。我的配置没有改变,这是正确的设置吗?
谢谢。
我的绑定配置:
<wsHttpBinding>
<binding name="BasicBinding">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate" />
<message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
我的服务:
<service behaviorConfiguration="APIServiceBehaviour" name="Service">
<endpoint address="api" binding="wsHttpBinding" bindingConfiguration="BasicBinding" name="soap-api" bindingNamespace="https://myserver.com" contract="IAIService" />
<host>
<baseAddresses>
<add baseAddress="https://myserver.com" />
</baseAddresses>
</host>
</service>
行为表现:
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="MyAuthorizationPolicy,MyProject" />
</authorizationPolicies>
</serviceAuthorization>
<serviceCredentials>
<serviceCertificate findValue="tempSClient" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<userNameAuthentication userNamePasswordValidationMode="Custom" includeWindowsGroups="false" customUserNamePasswordValidatorType="MyProject.UserAuth,MyProject" />
</serviceCredentials>
</behavior>
MyProject.UserAuth
看起来是什么样子? - sc3w