WCF SQLMembership自定义身份验证失败错误消息 [英] WCF SQLMembership customize authentication failure fault message
本文介绍了WCF SQLMembership自定义身份验证失败错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设法使SQLMembership与使用SSL的basichttpbinding一起使用.现在的问题是,当身份验证失败时,服务是否可能发送回更友好的消息,而不是:
I managed to make SQLMembership working with basichttpbinding using SSL. Now the questions is, is it possible that the service send back a more friendly message when authentication failes as opposed to:
从另一方收到不安全或不正确安全的错误.有关错误代码和详细信息,请参见内部FaultException.
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
和
邮件中至少有一个安全令牌无法验证.
At least one security token in the message could not be validated.
我对此有控制权吗?
感谢您的答复
SW
推荐答案
您好,您使用的是用户名/密码验证程序吗?您可能需要编写一个自定义验证器,该验证器使用SQL成员资格对用户进行身份验证,并在验证失败时引发自定义错误.请参阅 http://msdn.microsoft.com/en-us/library/aa702565.aspx .
Hello, are you using username/password validator? You may want to write a custom validator which authenticates the user using SQL membership, and throw a custom fault if validation fails. Please refer to http://msdn.microsoft.com/en-us/library/aa702565.aspx.
这篇关于WCF SQLMembership自定义身份验证失败错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文