views:

22

answers:

1

I created a custom Membership Provider which is now working in production just fine validating my WCF calls.

I do have an issue every now and then that for some unknown reason my provider cannot validate the user. In those cases I do not want the ValidateUser function to just return false, so I thought of throwing and excception with a little more help (not too much, just a little).

My problem is, even though I am throwing a ProviderException the client always gets a MessageSecurityException with no helpful info... just the good old:

"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."

with "An error occurred when verifying security for the message." in the Inner.

How can I get the message I am throwing in my own ValidateUser method? what about a custom behavior?

Thanks in advance

A: 

I found this post that led me to a solution, I'm not sure if it is the right move

http://stackoverflow.com/questions/856871/properly-catch-securitytokenexception-from-a-wcf-usernamepasswordvalidator

Basically I have to throw a FaultException which I'm not really happy abou because my Membership Provider implementation is WCF agnostic (or at least was until now) now it knows about FaultExceptions :(
Is there a better solution out there?

sebastian