How to set WCF security to require client certificate? -


I have a WCF service. I ask customers to certify with certificates This service configuration is:

  & lt; System.serviceModel & gt; & Lt; Services & gt; & Lt; Name of Service = "Film Library. File Manager" Practice Report = "Film Service. Service 1 Carrier" & gt; & Lt; Endpoint address = "manager" name = "certbinding" binding = "basicHttpBinding" contract = "moviecutter.film manager" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; Binding & gt; & Lt; BasicHttpBinding & gt; & Lt; Bond name = "custom_step" & gt; & Lt; Security mode = "message" & gt; & Lt; Message client CredentialType = "certificate" /> & Lt; / Safety & gt; & Lt; / Binding & gt; & Lt; / BasicHttpBinding & gt; & Lt; / Binding & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Behavior name = "Film service. Service maker" & gt; & Lt; ServiceCredentials & gt; & Lt; ClientCertificate & gt; & Lt; Authentication Trusted Trust Location = "Local Mackin" Certificate ValidationMode = "Peertrust" /> & Lt; / ClientCertificate & gt; & Lt; / ServiceCredentials & gt; & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt; & Lt; /system.serviceModel> & Lt; / Configuration & gt;  

Public key is established in local people, trusted people

The customer configuration is as follows:

   & Lt; Security mode = "message" & gt; & Lt; Message client CredentialType = "certificate" /> & Lt; / Safety & gt; & Lt; / Binding & gt; & Lt; / BasicHttpBinding & gt; & Lt; / Binding & gt; & Lt; Behavior & gt; & Lt; Endpoint beehaviors & gt; & Lt; Practice name = "certificate" & gt; & Lt; ClientCredentials & gt; & Lt; Client certification search current = "theme" store location = "current user" storename = "my" x509ind type = "search name" /> & Lt; / ClientCredentials & gt; & Lt; / Behavior & gt; & Lt; / EndpointBehaviors & gt; & Lt; / Behavior & gt; & Lt; Customers & gt; & Lt; Endpoint address = "[...] / Service1.svc / manager" binding = "Basic HttpBinding" Configuring Binding = "Certificates" Configure the behavior = "Certificates" contract = "Films service .file manager" name = "certificate" / & Gt; & Lt; / Customer & gt; & Lt; /system.serviceModel>  

Private, current user has private key installed.

Without security, the service works with security - it is not I tried several configurations and I got the error because the authentication has failed or I have to set the service certificate in client authentication element. Which I do not understand because I do not want to certify the service at all.

Instead

  & lt; Service credentials & gt; & Lt; ClientCertificate & gt; & Lt; Authentication Trusted Trust Location = "Local Mackin" Certificate ValidationMode = "Peertrust" /> & Lt; / ClientCertificate & gt; & Lt; / ServiceCredentials & gt;  

I think you should have

  & lt; Service Credentials & gt; & Lt; ServiceCertificate SearchWorldly = "theme" store location = "local menu" storename = "trusted people" x509FindType = "FindBySubjectName" /> & Lt; / ServiceCredentials & gt;  

You are not certifying this service, instead you are telling the service how to certify the client.


Comments

Popular posts from this blog

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

iphone - How do I make a UIPickerView in a UIActionSheet -