impress/config/initializers/warden.rb

18 lines
500 B
Ruby
Raw Normal View History

2010-10-18 14:58:45 -07:00
Rails.configuration.middleware.use RailsWarden::Manager do |manager|
manager.default_strategies :openneo_auth_token
2010-10-18 14:58:45 -07:00
manager.failure_app = SessionsController.action(:failure)
end
require 'openneo-auth'
require 'yaml'
2010-10-18 14:58:45 -07:00
Openneo::Auth.configure do |config|
YAML.load_file(Rails.root.join('config', 'openneo_auth.yml'))[Rails.env].each do |key, value|
2010-10-18 14:58:45 -07:00
config.send("#{key}=", value)
end
config.user_finder do |user_data|
User.find_or_create_from_remote_auth_data(user_data)
end
end