I have been creating a custom username/password validator for a WCF service and ran across the configuration item customUserNamePasswordValidatorType. I’ve been able to make my code work by following examples, but I just don’t understand what is going on. Unfortunately, the MSDN article doesn’t provide much detail.
This is the sample that Microsoft provides:
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Microsoft.ServiceModel.Samples.CalculatorService.CustomUserNameValidator, service" />
</serviceCredentials>
I’m trying to understand what the two parameters are to customUserNamePasswordValidatorType: “Microsoft.ServiceModel.Samples.CalculatorService.CustomUserNameValidator” and “service”.
Can someone please help me understand what these parameters mean?
Thanks!
This first parameter is the fully qualified name of the function the custom validation. The second parameter is the name of the assembly that function is contained in.
Taken from a much better example of how to use custom validators (modified slightly to fit your example)
The above would be complied inside a assembly named
service.