SHARE
TWEET

Untitled

a guest Jun 17th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private IWebOperationContext context = new WebOperationContextWrapper(WebOperationContext.Current); // Get the context
  2.  
  3. context.OutgoingResponse.StatusCode = HttpStatusCode.Unauthorized; // Set the 401
  4.      
  5. throw new WebFaultException(System.Net.HttpStatusCode.Unauthorized);
  6.      
  7. HttpContext context = HttpContext.Current;
  8. context.Response.StatusCode = 401;
  9. context.Response.End();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top