c# - Intercept WCF Method Call and "Re-route" based on Authentication status -


was curious if it was a way to check that a user method is authenticated before calling and then returning the custom object and The calls are not complete if they are not. For example:

We set user to request user in global.asax in user.pas.osthenticateRequest if they are authenticated or if they are not for anonymous users. All methods currently require authentication, we have something like the following code:

Public results GetSomeObject ()
{
If (HttpContext.Current.Request.IsAuthenticated)
{

}
} < / Code>

Bottom line: We want to be able to check authentication, before we can get WCF within the law, which requires authentication, and if true Continue if not, then Return Inam object back (JSON) with an authentication error.

What do you need to develop, which is called ServiceAuthorizationManager in WCF You can find more information:



Comments