views:

702

answers:

2

I couldn't find resources on how to use authlogic with sinatra. Or at least no documentation about a canonical way to do authentication with authlogic ...

Anyone has pointers to some tutorials, sample code or can sketch out a minimal authlogic/sinatra example?

Thanks in advance.

+1  A: 

Authlogic is written for Rails. The vast majority of its code is dependent on specific Rails components which are not easily duplicated in Sinatra (like controllers). While it's possible to use Authlogic with Sinatra it would take a ton of work and I don't think it's the right approach. A lightweight web framework should use a lightweight authentication mechanism. Take a look at the sinatra-authentication, which is well-documented, has some similar features to Authlogic, and is almost as easy to use.

Alex Reisner
from the authlogic docs it sounded like a quite framework agnostic plugin; that's why i asked this question; anyway .. thank you for your answer
The MYYN
Totally reasonable question--that first sentence in the Authlogic README is a little misleading.
Alex Reisner
@Alex "Authlogic can be used in any ruby framework you want: Rails, Merb, Sinatra, Mack, your own framework, whatever." -- http://rdoc.info/projects/binarylogic/authlogic
Adam Lassek
+3  A: 

Hi,

You need to check this out http://github.com/ehsanul/Sinatra-Authlogic-Template :)

good luck

include