Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A thin rails plugin on top of Warden for Authentication
Ruby
branch: master

This branch is 5 commits behind hassox:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
script
spec
.gitignore
CHANGELOG
Gemfile
Gemfile.lock
LICENSE
README.textile
Rakefile
TODO
VERSION
rails_warden.gemspec

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.