This project has moved. For the latest updates, please go here.

Authentication Options

May 1, 2013 at 12:12 PM
Hi,

I'm looking at the possibilities of Self Hosting a SignalR server and I'm trying to determine what authentication options are available. I asked in the SignalR JabbR room and was directed here because it falls under the responsibilities of Katana itself.

I think I'm going to require some custom authentication logic, though there may be some usage of something more standard like Active Directory or OAuth. So far I haven't been able to work out how to plug in to Katana to do any authentication at all.

What options are available to me 'out of the box' and how do I enable them? Additionally, how would I swap any potentially built-in logic for custom code?

Thanks in advance.
Coordinator
May 1, 2013 at 2:38 PM
There are several auth middleware currently under development. You can try the in progress Microsoft.Owin.Security.* packages from our myget.org feed: http://myget.org/f/katana/.

Here's some code using them:
https://katanaproject.codeplex.com/SourceControl/changeset/view/a2860d2d01b9b0949e9b370363a1c67388e22771#tests/Katana.Sandbox.WebServer/Startup.cs

See this sample for various ways of writing custom middleware (not auth specific):
https://github.com/owin/owin-samples/blob/master/MiddlewarePatterns/MiddlewarePatterns/Startup.cs

Classic windows auth is also supported, but that's built into the underlying servers (HttpListener, IIS) and needs to be configured there.
May 7, 2013 at 10:51 AM
Sorry for the delayed reply, I ended up getting caught up in some other work.

That's some great info, looks really useful. You say the Microsoft.Owin.Security.* bits are still in progress, is there any (even vague) timeline for when they will be officially available?

I'll give a couple of the options a go and see where I get to.

Thanks!
Coordinator
May 7, 2013 at 2:28 PM
There is a public beta coming up soon. The official release is still a few months out.
May 18, 2013 at 7:04 AM
Classic windows auth is also supported, but that's built into the underlying servers (HttpListener, IIS) and needs to be configured there.
Are there any examples available on how to configure that inside a console self host application? My missing link atm is how to get a reference to the mentioned underlying httplistener from webapp.start<startup>().
Coordinator
May 18, 2013 at 2:22 PM
In Startup.Configration(IAppBuilder app), do this:
HttpListener listener = (HttpListener)app.Properties["System.Net.HttpListener"];
May 22, 2013 at 7:43 PM
Edited May 22, 2013 at 7:44 PM
Quite helpful... Thanks :)