Having spent a lot of time reasoning about WCF and certificate based authentication, here's a scoop.
This forces WCF to expect a client side certificate for message based security:
<behavior name="DefaultBehavior" returnUnknownExceptionsAsFaults="false" > <serviceCredentials> <serviceCertificate x509FindType="FindBySubjectName" findValue="MyCertificate" storeLocation="LocalMachine" storeName="My"/> <clientCertificate> <authentication certificateValidationMode="ChainTrust" revocationMode="Online"/> </clientCertificate> </serviceCredentials> <metadataPublishing enableGetWsdl="true" enableMetadataExchange="true" enableHelpPage="true"/></behavior>
What it says is that the client certificate must validate according to the complete certificate chain. In broader terms it forces the caller to use the certificate that is 'validatable' on the service side. This means the following:
Other authentication options of certificateValidationMode and revocationMode include:
The <metadataPublishing> element is there just to allow WSDL/MetadataExchange endpoints to exist. It also allows the familiar service HTML page to pop up if you hit the endpoint (courtesy of enableHelpPage="true").
Another remark: Current February 2006 WCF CTP bits do not reflect the naming used in this post. For example revocationMode="Cached" was renamed from revocationMode=Offline", but don't be afraid of using it, nevertheless.
Remember Me
The opinions expressed herein are my own personal opinions and do not represent my company's view in any way.
My views often change.
This blog is just a collection of bytes.
Copyright © 2003-2024Matevž Gačnik
E-mail