Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top