I have a secure WCF service with a custom username password validator. Everything is finally working after a considerable amount of effort. I just have one last problem. Whenever I throw the exception to signal that the user's login credentials are incorrect, it gets translated to a MessageSecurityException with the message "Additional information: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."
If I originally threw a FaultException, the inner exception will contain the message I intended for the consumer to see ("Unknown Username or Incorrect Password"). If any other type of exception is thrown, the inner exception is literally just a duplicate of the non descriptive generic outer exception.
I really want the top level exception to contain the "Unknown Username or Incorrect Password" message. I even tried throwing my own MessageSecurityException with the desired message and even that didn't work. Does anyone how to know how to throw an exception from my validator such that the outer exception contains the message I want the consumer to see?