4

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.

miku
  • 181,842
  • 47
  • 306
  • 310

2 Answers2

7

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

good luck

include
  • 2,108
  • 16
  • 13
2

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
  • 29,124
  • 6
  • 56
  • 53
  • 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 – miku Dec 17 '09 at 14:41
  • Totally reasonable question--that first sentence in the Authlogic README is a little misleading. – Alex Reisner Dec 17 '09 at 14:46
  • "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 Aug 19 '10 at 23:41