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.