Changes

Jump to: navigation, search

Auth Module

1,397 bytes added, 16:17, 19 June 2012
no edit summary
[[Category:Umlaut]]
 
=WARNING: This is Outdated Documentation!!!!=
 
'''THIS IS OUTDATED DOCUMENTATION''' See new Umlaut documentation at http://github.com/team-umlaut/umlaut/wiki
---------
 
== Auth Module (Developer Notes) ==
The Auth module extends functionality available from the [Authlogic|http://github.com/binarylogic/authlogic] (version 2.1.0) gem and included in the lib directory based on the [Authlogic OpenID add-on|http://github.com/binarylogic/authlogic_openid].'
The idea is to allow services to be customized based on a logged in user 's attributes.
Some examples could be:
* Store a user's mobile phone number or email address to default the txt/email values for those services.
* Provide extended request or paging functionality that is only available to a subset of patrons.
* Allow faculty members to place items on reserve from the Umlaut screen.
 
Currently the Auth module requires existing Umlaut users to install the authlogic gem and perform a rails migration to update the user model to work with authlogic and the auth module. After these two steps have been taken, the auth module should only take effect if a particular instance has defined a auth module in their local config.
=== Umlaut Files Added or Updated ===
=== Auth Module Example ===
AuthPDS was developed at NYU as an example of generating a plugin and populating the stub methods provided.
 
At NYU we're currently using the Auth module in our holdings table to offer request functionality based on "patron status". We display a request button, if the patron has the appropriate status to be able to request/page items and use a custom controller to provide this functionality seamlessly. Screenshots of this functionality can be seen below.
 
==== lib/auth/local/auth_pds.rb ====
The AuthPDS module gets mixed in with the Session module to log in via PDS (customized for NYU). It implements the following callback functions:
# 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
# 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
}
</pre>
==== Screenshots of Request Functionality ====
===== Not logged in, no request =====
No request button because generally patrons can't request available items.
 
[[Image:Umlaut_no_request.png]]
 
===== Logged in, request =====
Now the request button appears because I have permission to request available items.
[[Image:Umlaut_request.png]]
 
===== Pretty jQuery modal dialog =====
You get the modal dialog upon clicking the request button
[[Image:Umlaut_request_modal.png]]

Navigation menu