tags:

views:

125

answers:

3

I'm trying to use OpenRasta for a simple RESTful service. This service needs to be secured with either http Basic authentication or (preferably) Digest.

Looking around the net, there are tens of webpages writing how wonderful OpenRasta is and that it even supports Digest authentication but I haven't been able to find a single example of how to enable either of those for my service.

Putting a RequiresAuthentication on my method or handler doesn't seem to be doing anything.

Has anyone actually done this ever before? Or is it just a dreamware?

UPDATE: I gave up on getting to work and went with Scott Littlewoods fork of OpenRasta. He has changed the way authentication works and using his implementation, I managed to do both Basic and Digest.

A: 

Look at the classes in OpenRasta.Security. THere's an IAuthenticationProvider you need to implement and register in the container for digest to kick in.

Check the debug log if after doing this it still doesn't work, and send a copy of it on the mailing lists, people there will be able to help you.

serialseb
Putting dependency to IAuthenticationProvider in the IoC didn't help and my question has been sitting in OpenRasta google groups for as long as this one. At least I got some feedback here!
Khash
Sorry I've been without a laptop for a week and am not monitoring the mailing list as closely as I should. The [RequiresAuthentication] attribute will ensure that the call only succeeds for authenticated users (which is default .net authentication through IPrincipal). When you register an authentication provider, the HTTP Digest handler will kick in, otherwise it won't.
serialseb
@SerialSeb - How do you register with the container? Elsewhere you point to http://trac.caffeine-it.com/openrasta/wiki/Doc/DependencyInjection#Howaboutmyowninterfaces but that doesn't talk about authentication. I implemented IAuthenticationProvider, and I decorated a handler with [RequiresAuthentication], so I do get prompted for authentication, but it doesn't seem to hit my Authentication class.
pc1oad1etter
A: 

I think the issue is with the use of Cassini (built in to VS.NET) to debug. Cassini doesn't support authentication like IIS does. When I switched to using IIS it began to prompt me for authentication.

Jake Stevenson
+2  A: 

I've put together a small blog post and sample application to show how to enable Digest Authentication using the current RTM of OpenRasta.

http://scottondotnet.blogspot.com/2010/10/openrasta-digest-authentication.html

The source code can be found here: http://github.com/scottlittlewood/OpenRastaDigestDemo

Scott Littlewood