Tl;dr: You can use NTLM authentication without relying on IIS or HttpListener in OWIN projects by using my OWIN autentication middleware: more information on my Github project: Pysco68.Owin.Authentication.Ntlm middleware. It’s working flawlessly with ASP.NET Identity 2.0! And there’s a Nuget package too!
As you may have noticed, I’m relatively busy these days with things like OWIN and surrounding technologies. All there shiny and new things that just fit together so well. And then you have customers just requiring plain old things like NTLM for their latest shiny intranet application.
On a recent machine-to-machine communication scenario I needed to enable secure push messages. The server side of the project was plain ASP.NET Web API 2 (on OWIN – I just love it) so dropping in SignalR and a few hubs was done in minutes. The tricky part was that I was using the Hawk authentication scheme to secure the access (and I was very happy on how it worked out so far). So no reason to change anything about the global setup if it wasn’t for the .NET SignalR client library not supporting Hawk out-of-the-box.
But luckily SignalR sources can be crawled through easily over at github (https://github.com/SignalR/SignalR). And even more luckily I found that it would be no more that a few lines to wire it up with Thinktecture’s Hawk implementation (Thinktecture.IdentityModel.Hawk on Nuget).
So there you go, my latest, greatest Nuget packages is: Pysco68.SignalR.HawkHandler.
…I finally made it: ASP.NET Identity 2.0 running with MariaDB! It was more difficult than I expected it to be. I’ve been using EntityFramework with MySQL successfully in my day-time job for over two years now. As I was starting a small toy project at home last week I decided to go the easy route: ASP.NET Web API 2 running in an OWIN application. That was the perfect opportunity for giving ASP.NET Identity 2.0 a shot – instead of rolling my own authentication framework.
I still believe that this choice isn’t bad at all, but I underestimated the cost of getting it to run in a heterogeneous environment (read: not everything is Microsoft technology).
Surprisingly (to me – but hey!) Microsoft is providing an example of how to use MySQL and EntityFramework 6 as a storage provider for ASP.NET Identity 2.0. Sadly the example isn’t working out of the box – at least not in my setup. One aspect is that when they wrote the tutorial the MySQL Connector/NET wasn’t supporting EF Code-first migrations as well as it does nowadays. The second issue was the primary keys in the ASP.NET Identity tables being too long for MySQL.