Thinktecture Identity model has support for Eran Hammer’s Hawk authentication in the form of OWIN middleware. With ASP.NET vNext introducing a new but very similar middleware concept (changes only on the API surface and OWIN middleware can be used as-is in ASP.NET VNext apps), I took the opportunity to completely rewrite the middleware. As ASP.NET vNext is being actively developed, there could be changes and this middleware will change to react to those changes. Hence, at this point, this middleware is just for review only. Since Linus had said “Talk is cheap. Show me the code.”, I keep this blog post very short and just link to github. Your feedback is welcome.
There are already posts out there explaining how to setup ASP.NET vNext. The first and the foremost source, ASP.NET vNext Home in Github has all the steps clearly documented. Then, there is a ton of videos and good stuff out there. The objective of this post is to show the steps involved in setting up ASP.NET vNext and create a “complete” MVC application (remember MVC in vNext means MVC + Web API). Of course, we will not need to install VS 2014 but I don’t think it will be practical to do any serious development without VS. But then, just to get a taste of what vNext is, it is okay. Here are the steps (Windows only).
If you use Visual Studio and want to add Google sign-in to your ASP.NET MVC app by using an out of box template, you get code that uses ASP.NET identity and three Katana authentication middleware: (1) the cookie authentication middleware running in active mode, (2) another instance of cookie authentication middleware but running in passive mode, and (3) Google authentication middleware. That will be like so.