Cannot find the X.509 certificate
Hello,
I am having difficulty securing a WCF service. I have created a test service and am trying to ensure I can authenticate and authorize with the ASP.NET membership and role providers I have defined. I have it working if I leave it unsecured, but once I try to secure it, I am running into problems:
I used the Web Service Software Factory to define the security, to ensure I wouldn't misname any of the attributes or anything. It is configured for Direct Authentication using a username token whose source will be an SQL database store from the Membership Provider I have defined. The certificate was chosen via the selection dialog that is part of the Web Service Software Factory, so I am inclined to believe that the path it outputs is correct.
Anyway, here is my current web.config:
<
system.serviceModel><
behaviors><
serviceBehaviors><
behaviorname="DirectAuthenticationUserNameTokenSQL"><
serviceMetadatahttpGetEnabled="true" /><
serviceDebugincludeExceptionDetailInFaults="true" /><
serviceCredentials><
serviceCertificatefindValue="CN=xxxx"storeLocation="LocalMachine" storeName="Root"x509FindType="FindBySubjectDistinguishedName" /><
userNameAuthenticationuserNamePasswordValidationMode="MembershipProvider" membershipProviderName="SqlMembershipProvider" /></
serviceCredentials><
serviceAuthorizationprincipalPermissionMode="UseAspNetRoles" roleProviderName="SqlRoleProvider" /></
behavior></
serviceBehaviors></
behaviors><
services><
servicebehaviorConfiguration="DirectAuthenticationUserNameTokenSQL" name="WebServices.Core.ServiceImplementation.SettingsService"><
endpointbinding="wsHttpBinding"bindingConfiguration="DirectAuthenticationUserNameTokenSQL" bindingNamespace="WebServices.Core.ServiceContracts/2007/07" contract="ServiceContracts.ISettingsService" /><
endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange" /></
service></
services><
bindings><
wsHttpBinding><
bindingname="DirectAuthenticationUserNameTokenSQL"><
securitymode="Message"><
messageclientCredentialType="UserName"negotiateServiceCredential="true" establishSecurityContext="true" /></
security></
binding></
wsHttpBinding></
bindings></
system.serviceModel>Is there something wrong with this service configuration? I can't find anything wrong, but it is giving me the error:
Cannot find the X.509 certificate using the following search criteria: StoreName 'Root', StoreLocation 'LocalMachine', FindType 'FindBySubjectDistinguishedName', FindValue 'CN=xxxx'.
The only thing I can think of is something is preventing the certificate from being loaded, or maybe even preventing it from even being seen.
Thanks for the help,
Brandon

