Sha256: b173ea1d2f45051679d5a1829883ba75244b5a855144a2424e658596beb8fed5

Contents?: true

Size: 873 Bytes

Versions: 8

Compression:

Stored size: 873 Bytes

Contents

h1. Rails Warden

Provides authentication for Rails applications via the "Warden":http://github.com/hassox/warden Rack authentication framework.

Require the gem:

config/environment.rb

<pre><code>
  config.gem "rails_warden"
</code></pre>

Setup an initializer:

config/initializers/warden.rb

<pre><code>
  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, 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
  
</code></pre>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_warden-0.5.6 README.textile
rails_warden-0.5.5 README.textile
rails_warden-0.5.4 README.textile
rails_warden-0.5.3 README.textile
rails_warden-0.5.2 README.textile
rails_warden-0.5.1 README.textile
rails_warden-0.5.0 README.textile
rails_warden-0.3.0 README.textile