views:

313

answers:

1

I'm trying to find a solution to add HTTP digest auth to a site that uses Authlogic.

Authlogic itself only supports HTTP simple auth.

I'm googling and googling and can't find any ready solution or even an outline.

+1  A: 

Assuming your Authlogic session model is called UserSession, you can always log a user in by creating a session manually, like this:

UserSession.create(user)

So, what you could do is use Rails' built in support for HTTP Digest authentication to authenticate the user, then if they are successfully authenticated, add the UserSession.create(user) call to log them in with Authlogic.

This is how I handle logging users in from, say, Twitter.

Luke Francl