protected override HttpRequestMessage ProcessRequestHandler(HttpRequestMessage request, CancellationToken cancellationToken)
{
try
{
var principal = PrincipalHelper.GetPrincipalFromHttpRequest(request);
if (principal == null)
{
this.Unauthorized();
}
var user = Membership.GetUser(principal.Identity.Name);
if (user == null)
{
this.Unauthorized();
}
PrincipalHelper.SetPrincipal(request, principal);
}
catch
{
this.Unauthorized();
}
return request;
}