简体   繁体   English

WCF 服务认证消息

[英]WCF Service authentication messages

I'm writing a WCF service with authentication and have stumbled across this: I can't seem to define the messages returned in the event of an error in authentication (that is to say: user is not authenticated).我正在编写一个带有身份验证的 WCF 服务,并且偶然发现了这一点:我似乎无法定义在身份验证出错时返回的消息(也就是说:用户未通过身份验证)。

I have an IErrorHandler implementation in place, however that doesn't appear to catch the exceptions thrown ( SecurityTokenException or FaultException<T> ) during auth.我有一个 IErrorHandler 实现,但是它似乎没有捕获在身份验证期间抛出的异常( SecurityTokenExceptionFaultException<T> )。 I can confirm that it works in the rest of scenarios, however.但是,我可以确认它适用于 rest 的场景。

Is there something I'm missing here?我在这里缺少什么吗? Or is it really not possible to catch and handle exceptions thrown in auth?还是真的无法捕获和处理身份验证中抛出的异常?

Thanks谢谢

IErrorHandler can't handle the exception that happens in the authentication process. IErrorHandler 无法处理身份验证过程中发生的异常。 Why do you want to handle the authencation exception?为什么要处理身份验证异常?

Your client side can catch the authentcation exception.您的客户端可以捕获身份验证异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM