0

I'm using custom validation with WCF web service. I'm using wsHttpBinding :

 <wsHttpBinding>
        <binding name="CustomBinding">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None"/>
            <message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false"/>
          </security>
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="13107200"/>
        </binding>
      </wsHttpBinding>

My behavior looks like that :

    <behavior name="SecureServiceBehavior" >
      <serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000" maxConcurrentInstances="1000"/>
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom" includeWindowsGroups="false" customUserNamePasswordValidatorType="PSA904.CustomValidator, PSA904"/>
        <windowsAuthentication includeWindowsGroups="false"/>
      </serviceCredentials>
    </behavior>

And my services look like that :

<services>
  <service name="PSA904.PSA904External" behaviorConfiguration="SecureServiceBehavior" >
    <endpoint binding="wsHttpBinding" contract="PSA904.IPSA904External" bindingConfiguration="CustomBinding"/>
  </service>
  <service name="PSA904.PSA904Internal" behaviorConfiguration="SecureServiceBehavior" >
    <endpoint binding="wsHttpBinding" contract="PSA904.IPSA904Internal" bindingConfiguration="CustomBinding"/>
  </service>
</services>

When I deploy my application, it shows this error :

System.ServiceModel.FaultException: An error occurred when processing the security tokens in the message.

N.Farouk
  • 21
  • 9
  • Not sure if this old post of mine might help: https://stackoverflow.com/questions/1165078/wcf-client-using-certificate-and-username-password-credentials/1168988#1168988 – Tanner Nov 13 '18 at 20:02
  • Or this: https://stackoverflow.com/a/560384/57475 – Tanner Nov 13 '18 at 20:05

0 Answers0