Skip to content
A thin rails plugin on top of Warden for Authentication
Ruby
Find file
Latest commit 729809e Feb 27, 2014 3 @jsmestad jsmestad remove Gemfile.lock
Failed to load latest commit information.
lib
script Initial Commit Jun 4, 2009
spec run tests on all other versions of rails to make sure they pass Jun 6, 2012
.gitignore remove Gemfile.lock Feb 27, 2014
CHANGELOG
Gemfile add bump Feb 25, 2014
LICENSE
README.textile
Rakefile
TODO Initial Commit Jun 3, 2009
rails_warden.gemspec v0.5.8 Feb 25, 2014

README.textile

Rails Warden

Provides authentication for Rails applications via the Warden Rack authentication framework.

Require the gem:

config/environment.rb


  config.gem "rails_warden"

Setup an initializer:

config/initializers/warden.rb


  Rails.configuration.middleware.use RailsWarden::Manager do |manager|
    manager.default_strategies :my_strategy
    manager.failure_app = LoginController
  end

  # Setup Session Serialization
  class Warden::SessionSerializer
    def serialize(record)
      [record.class.name, record.id]
    end

    def deserialize(keys)
      klass, id = keys
      klass.find(:first, :conditions => { :id => id })
    end
  end

  # Declare your strategies here
  #Warden::Strategies.add(:my_strategy) do
  #  def authenticate!
  #    # do stuff
  #  end
  #end
  
Something went wrong with that request. Please try again.