Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

Tie a wcf service to a particular client cert

$
0
0

I have a wcf service which has requires ssl and client certificate is required.  The problem I am having is "I have 2 valid client certs on my machine say ClientCert and BIS. I am using ClientCert with the above said wcf service and BIS with another web service. Both these client certs are trusted by my server. So when I access the wcf service, if I submit BIS client cert instead of Clientcert, it still works. This confuses me.

Is there any way I could make my wcf service tie to a particular client cert so that the service is available only if they present the correct client certificate"?

my wcf service config as follows:

<services><service name="MyWebservice.TWebservice" behaviorConfiguration="TServiceBehaviour"><endpoint address=""
              binding="basicHttpBinding"
              bindingConfiguration="secureHttpBinding"
              contract="MyWebservice.ITCredSearchWebService"/></service></services><bindings><basicHttpBinding><binding name ="secureHttpBinding"><security mode ="Transport"><transport clientCredentialType ="Certificate">             </transport></security></binding></basicHttpBinding></bindings><behaviors><serviceBehaviors><behavior name ="TServiceBehaviour"><serviceCredentials><clientCertificate><authentication certificateValidationMode="PeerOrChainTrust" trustedStoreLocation="LocalMachine"/></clientCertificate></serviceCredentials><serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" /><serviceDebug includeExceptionDetailInFaults="false"/></behavior></serviceBehaviors></behaviors><serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

my client web app's config as follows

<client>
 
<endpointaddress="https://localhost/TWebService/TSearchWebService.svc"
           
behaviorConfiguration="TEndPointBehavior"
           
binding="basicHttpBinding"
           
bindingConfiguration="BasicHttpBinding_ITCredSearchWebService"
           
contract="TWebservicereference.ITCredSearchWebService"
           
name="BasicHttpBinding_ITCredSearchWebService"/>
</client>
<bindings>
 
<basicHttpBinding>
   
<bindingname="BasicHttpBinding_ITCredSearchWebService">
     
<securitymode="Transport">
       
<transportclientCredentialType="Certificate">
       
</transport>
     
</security>
   
</binding>
 
</basicHttpBinding>
</bindings>
<behaviors>
 
<endpointBehaviors>
   
<behaviorname="TEndPointBehavior">
     
<clientCredentials>
       
<clientCertificatestoreLocation="LocalMachine"  storeName="My"x509FindType="FindBySubjectName"findValue="ClientCert"/>
     
</clientCredentials>
   
</behavior>
 
</endpointBehaviors>
</behaviors>

Please help me. Thanks in advance.


Viewing all articles
Browse latest Browse all 7363

Trending Articles