Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I'm newer at creating WCF web services and I'm trying to figure out how to create a WCF service that conforms to the WSS:X509 Token Profile 1.0. There are many posts about how to do the client configuration however, not much about server configurations.
This project began as a WSDL-first generated service, so I am unable to change anything about how the client sends data to me, and I'm required to make the service conform to the data they send.
I've gone and created a custom endpoint for this service, however this is where i'm stuck. I'm sure theres just some small detail i'm missing to make it conform to the pdf below:

http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0.pdf

HTML
<behavior name="Something.ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceCredentials>
        <clientCertificate>
          <authentication certificateValidationMode="None" />
          <certificate findValue="ClientCertificate" 
                       storeLocation="LocalMachine" 
                       storeName="My" 
                       x509FindType="FindBySubjectName" />
        </clientCertificate>
        <serviceCertificate findValue="OurCertificate" 
                            storeLocation="LocalMachine" 
                            storeName="My" 
                            x509FindType="FindBySubjectName"/>
      </serviceCredentials>
      <serviceSecurityAudit auditLogLocation="Application"
                            serviceAuthorizationAuditLevel="Failure"
                            messageAuthenticationAuditLevel="Failure"
                            suppressAuditFailure="true" />
    </behavior>
  </serviceBehaviors>

  <service behaviorConfiguration="Something.ServiceName"
    name="Something.ServiceName">
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" name="MetaDataEndPoint" contract="IMetadataExchange" />
    <endpoint address="" binding="customBinding" bindingConfiguration="CustomBinding0" name="customBindingEndPoint" contract="Something.IServiceName" >
    </endpoint>

    <binding name="CustomBinding0">
      <textMessageEncoding messageVersion="Soap12" />
      <security authenticationMode="MutualCertificate" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11" />
      <httpTransport />
    </binding>
Any Help/Comments is greatly appreciated.
Posted

1 solution

Well, the above was basically correct. I just needed to tweak how it found the certificate (by thumbprint instead of by name) and it worked perfectly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900