Skip to content

A thin rails plugin on top of Warden for Authentication

License

Notifications You must be signed in to change notification settings

rall/rails_warden

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  Warden::Manager.serialize_into_session{ |user|      [user.class, user.id] }
  Warden::Manager.serialize_from_session{ |klass, id| klass.find(id)        }

  # Declare your strategies here
  #Warden::Strategies.add(:my_strategy) do
  #  def authenticate!
  #    # do stuff
  #  end
  #end
  

About

A thin rails plugin on top of Warden for Authentication

Resources

License

Stars

Watchers

Forks

Packages

No packages published