katana

What is the purpose of the extension method CreatePerOwinContext in OWIN implementation by Microsoft

£可爱£侵袭症+ 提交于 2019-11-27 18:41:43
I am a newbie in ASP.NET, and currently learning ASP.NET Identity. I know it's built on top of OWIN implementation by Microsoft, and I am also still learning that too. So, I came across the extension method CreatePerOwinContext in the Owin startup code, and I don't see a clear purpose of using it. Is it some kind of dependency injection container? What is the real purpose of the method? In what case it should be applied? CreatePerOwinContext registers a static callback which your application will use to get back a new instance of a specified type. This callback will be called once per request

Unhandled Exception Global Handler for OWIN / Katana?

拟墨画扇 提交于 2019-11-27 18:30: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 same class (with a breakpoint set on the first line): private static void CurrentDomain

MVC 5 application - implement OAuth Authorization code flow

牧云@^-^@ 提交于 2019-11-27 17:54:52
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 authorization code for a Access token to Access the Resource Server. This is the Authorization code flow as

Owin cookie authentication set-cookie not saving in browser

牧云@^-^@ 提交于 2019-11-27 17:46:07
问题 I am building self-hosted web server on this stack: OWIN Nancy Web Api 2 And I am using Microsoft.Owin.Security.Cookies from Katana for forms-like authentication. I got Set-Cookie header in response, but cookie don't being saved and not being included in next request. So what's the problem? What I am doing wrong? Owin startup: app.UseCookieAuthentication(new CookieAuthenticationOptions() { AuthenticationMode = AuthenticationMode.Active, AuthenticationType = "GM", CookieHttpOnly = true,

How to explain Katana and OWIN in simple words and uses?

岁酱吖の 提交于 2019-11-27 08:54:51
问题 I have read many articles about the OWIN and Katana projects, but I could not get the whole picture of it. For a normal web developer who uses ASP.NET: What exactly is OWIN and what problems does it solve (in simple words). What is its relation to IIS? Does OWIN replace IIS? if not, in what situations does OWIN best fit? How could OWIN help me in my daily work projects? How could OWIN help me in a self-improvement projects? 回答1: Regarding the comment above, OWIN is not a framework. OWIN is a

GoogleOauth2 Issue Getting Internal Server 500 error

心不动则不痛 提交于 2019-11-27 05:43:11
问题 I decided to give the new Google Oauth2 middleware a try and it has pretty much broken everything. Here is my provider config from startup.auth.cs.. When turned on, all of the providers including the google provider get a 500 internal server on Challenge. However the details of the internal server error are not available and I cant figure out how to turn on any debugging or tracing for the Katana middleware. Seems to me like they were in a rush to get the google Oauth middleware out the door.

No owin.Environment item was found in the context

痴心易碎 提交于 2019-11-27 03:04:00
问题 Microsoft recently introduced new ASP.NET Identity - replacement for old (Simple)Membership. Unfortunately, I can't use this new membership system in my old project because it throws System.InvalidOperationException: No owin.Environment item was found in the context. This is a known bug, but Microsoft keeps silence about this issue. The easiest way to reproduce this bug - it's to create a new web application (MVC, WebForms or WebApi - doesn't matter) in VS 2013 (with Web Tools 2013 Preview

How do you set katana-project to allow token requests in json format?

≡放荡痞女 提交于 2019-11-27 02:06:00
问题 When I setup an OAuth Authorization Server in asp.net webapi 2 how can I set the token endpoint to accept json rather then a form encoded post? Using the sample http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api I tried to send application/json with { "grant_type":"password", "username":"Alice", "password":"password123" } I receive the response 400 Bad Request { "error" : "unsupported_grant_type" } where as a content type of application/x-www-form-urlencoded and body

CORS is not working in web api with OWIN authentication

守給你的承諾、 提交于 2019-11-27 00:56:56
问题 In my application i am using web api with token based authentication with CORS support, but when client request for the token, an error occured due to CORS (Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (my site name) . This can be fixed by moving the resource to the same domain or enabling CORS.) I had configured everything required for CORS support ( i think so). here my configuration Owin start up class public class Startup { public void

What is the purpose of the extension method CreatePerOwinContext in OWIN implementation by Microsoft

喜欢而已 提交于 2019-11-26 19:33:28
问题 I am a newbie in ASP.NET, and currently learning ASP.NET Identity. I know it's built on top of OWIN implementation by Microsoft, and I am also still learning that too. So, I came across the extension method CreatePerOwinContext in the Owin startup code, and I don't see a clear purpose of using it. Is it some kind of dependency injection container? What is the real purpose of the method? In what case it should be applied? 回答1: CreatePerOwinContext registers a static callback which your