2010-10-18 14:58:45 -07:00
|
|
|
require 'openneo-auth'
|
2010-11-13 07:37:57 -08:00
|
|
|
require 'yaml'
|
2010-10-18 14:58:45 -07:00
|
|
|
|
|
|
|
Openneo::Auth.configure do |config|
|
2010-11-13 07:37:57 -08:00
|
|
|
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
|
|
|
|
|
2010-11-13 16:42:56 -08:00
|
|
|
config.remote_auth_user_finder do |user_data|
|
2010-10-18 14:58:45 -07:00
|
|
|
User.find_or_create_from_remote_auth_data(user_data)
|
|
|
|
end
|
2010-11-13 16:42:56 -08:00
|
|
|
|
|
|
|
config.remember_user_finder do |id|
|
|
|
|
User.find_by_id(id)
|
|
|
|
end
|
2010-10-18 14:58:45 -07:00
|
|
|
end
|