Changes

Jump to: navigation, search

Auth Module

1,182 bytes added, 19:17, 20 January 2011
Updated with changes for latest version
</pre>
==== db/schema.rb ====
Modified the user table to use with authlogic. Included column for mobile phone, user attributes and a refreshed_at date to track age of a particular record for better performance. By default, data expires after 1 week.
==== lib/service.rb ====
Make the user accessible from a particular user via the session_user method.
# logout_url - provides PDS logout URL
# after_logout - destroys some cookies that were stored to improve performance
# on_every_request - checks if the user has logged in (e.g. from another PDS SSO system)
==== config/umlaut_config/environment.rb ====
The auth configuration settings are added to the local environment.rb to establish the appropriate class to mix in and to pass various options to the module.
<pre>
config.app_config.login = {
# File name
:id => "auth_pds",
# Class name
:module => :AuthPDS,
:options => {
# Make expiration date configurable
:expiration_date => lambda {return 1.week.ago},
# OpenSSO URL, specific to NYU's implementation of PDS. Could easily be removed to make the local PDS module more generic.
:opensso_path => "https://login.nyu.edu:443/sso",
# PDS URL
:pds_url => "https://pds.library.institution.edu:443/",
# System name since the module is used in many different contexts and different apps
:system_name => :umlaut,
# Cookie name that is used to help with performance since the module is used in many different contexts and different apps
:cookie_name => :nyulibrary_opensso_umlaut,
:additional_user_attributes => lambda do |user_session|
h = {}
# NYU is using this module for several of our ruby apps and this mechanism allows us to include different user attributes per system.
# It's included here to give an idea of the flexibility of the module.
return h
end
}
}
</pre>
58
edits

Navigation menu