katana

Unhandled Exception Global Handler for OWIN / Katana?

本秂侑毒 提交于 2019-11-26 19:28:58
问题 What is the proper way to implement a global Exception catcher-handler in a Katana (OWIN) implementation? In a self-hosted OWIN/Katana implementation running as an Azure Cloud Service (worker role), I placed this code in a Middleware: throw new Exception("pooo"); Then I placed this code in the Startup class Configuration method, setting a breakpoint in the event handler: AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledExceptionEventHandler; and the event handler in the

MVC 5 application - implement OAuth Authorization code flow

百般思念 提交于 2019-11-26 19:03:41
问题 Based on this tutorial http://www.asp.net/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server, I have created an Authorization Server, a Resource Server and a MVC Client. The MVC Client has a Controller which gets some data from the Resource Server. The Resource Server requires authentication. The MVC Clients gets an authorization code from the Authorization Server and Redirects the user to the Authorization Server for authentication. Finally the MVC Clients exchanges the

How can I safely intercept the Response stream in a custom Owin Middleware

夙愿已清 提交于 2019-11-26 16:34:20
问题 I'm trying to write a simple OWIN Middleware, in order to intercept the response stream. What I'm trying to do is replace the original stream with custom Stream-based class, where I will be able to intercept writes to the response stream. However, I'm facing some issues because I cannot know when the response has been completely written to by inner middleware components in the chain. The Dispose override of the Stream is never called. So I don't know when it's time to perform my processing,