The caller was not authenticated by the service. RRS feed

  • Question

  • hi

    i create s wcf service with certificate

    web config server :

            <binding name="wsHttpEndpointBinding">
              <security >
                <message clientCredentialType="Certificate" />
      <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
            <behavior name="Service.erviceBehavior">
              <serviceMetadata httpsGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
                  <authentication certificateValidationMode="PeerTrust"/>
                <serviceCertificate findValue="WcfService" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>

    web config Client :

                    <binding name="WSHttpBinding_IService">
                        <security >
                            <message clientCredentialType="Certificate"  />
                <endpoint address="http://localhost:8020/Service.svc"
                    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
                    contract="myServiceReference1.IService" name="WSHttpBinding_IService"
                    behaviorConfiguration="CustomBehavior" >
                        <dns value="WcfServer" />
            <behavior name="CustomBehavior">
                <clientCertificate findValue="WcfServer" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My"/>
                  <authentication certificateValidationMode="PeerTrust"/>

    but i  get this error :

    The caller was not authenticated by the service.

    please help me for resolve it

    it's urgent


    Sunday, October 19, 2014 7:07 AM


  • Hi vahidbakhtiary,

    I see that your client endpoint address is http://localhost:8020/Service.svc, so please try to change the mexHttpsBinding to the mexHttpBinding as following:

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

    Since you met the error "the caller could not be authenticated by the service", it seems that you do not configure the certificate authentication very well. So please try to check the following articles to see if you have done something wrong:
    #WCF message security and client certificate authentication: .

    #Nine simple steps to enable X.509 certificates on WCF: .

    Best Regards,
    Amy Peng

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 20, 2014 10:26 AM