Today, I ill like introduce you to AuthLogic, a simple authentication solution for Ruby built by Ben Johnson
AuthLogic is unobtrusive and pretty low-level. It does not rely on generated code (like Devise, for example) - instead it provides only the tools that you can use to code your app the way you like. In a sense, AuthLogic is similar to Sorcery.
Let's build a Rails app to allow users to register, sign in,and out, as well as reset their password. While doing this, we will discuss AuthLogic's various features and settings. After reading this tutorial you will be ready to use AuthLogic in your real projects.
Source code can be found on GitHub.
Demo app is available at sitepoint-authlogic.herokuapp.com.
Getting Started
The demo app that I am going to show you is built with Rails 4.1, but AuthLogic supports Rails 3, and even Rails 2 (there is a separate branch for it).
Create a new "Logical" app without the default testing suite:
[bash]
$ rails new Logical -T
[/bash]
Drop in the following gems:
Gemfile
[ruby]
[...]
gem 'bootstrap-sass'
gem 'authlogic', '3.4.6'
[...]
[/ruby]
and run
[bash]
$ bundle install
[/bash]
Continue reading %Rails Authentication with Authlogic%
by Ilya Bodrov-Krukowski via SitePoint
No comments:
Post a Comment