Allan
Allan

Reputation: 2939

WCF Client Certificate stopped working

After following a few MSDN articles I had client certificates and user name passwords working for my WCF service. The client required a certificate and a username and password to access my service.

Recently, the certificate stopped working, I can access the service without supplying the client certificate. I am using SOAP UI to test the client. Normally I have to add the client cert to the key store and then specify which key to use for the request.

Recently I set up a test and I didn't have to supply the client cert. Nothing in my conifg changed. Do I have the set up properly?

Thank you.

My Binding Config:

 <wsHttpBinding>
        <binding name="BasicBinding">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Certificate" />
            <message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false" />

          </security>

        </binding>
      </wsHttpBinding>

My Service:

<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>

The Behavior:

      <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>

Upvotes: 7

Views: 194

Answers (1)

Philippe Matray
Philippe Matray

Reputation: 1521

The certificates have an expiration date. Did you check you certificate in certmgr.msc ?

Upvotes: 1

Related Questions