History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-1876
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Andrew Wills
Reporter: Tuyhang Ly
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
uPortal

Different session timeouts by group membership

Created: 15/Nov/07 03:08 PM   Updated: 23/Sep/08 08:09 PM
Component/s: Authentication, Framework, Permissions
Affects Version/s: None
Fix Version/s: 3.1.0, 3.0.3

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File UP-1876.patch (9 kb)
2. Text File UP-1876.patch (8 kb)



 Description  « Hide
Use case: Unauthenticated users might have really short sessions, students might have 15 minute sessions, and staff or faculty might have hour long sessions, there might be a "grumpy user" group needing *really* long sessions.

More generally, ability to map group memberships to session lengths.
User gets longest session timeout available to a group of which he or she is a member. (user that is both student and faculty would get hour long session in example above).

Code sketch at:
http://www.ja-sig.org/wiki/x/u4t7

 All   Comments   Work Log   Change History      Sort Order:
Andrew Wills [22/Sep/08 07:26 PM]
I'm attaching a patch that implements this enhancement.

The session timeout (a.k.a. max-inactive) values can be set using permissions. Using the existing permissions infrastructure for this purpose is attractive because:

  • permissions can be applied to users and/or any flavor of groups
  • permissions entries come in GRANT and DENY, for more options in administration
  • permissions can already be managed effectively by the portal UI and Import/Export

Here's how it works...

If you don't use these permissions, nothing changes: you get exactly the same behavior as before.

If you do wish to use the feature, use permissions with the 'MAX_INACTIVE' activity where the target is an integer. Positive values will set the session timeout to that amount (in seconds); negative values indicate the session never times out.

These settings are applied just after the user authenticates in the LoginServlet. You can specify both GRANT and DENY entries, and DENYs trump GRANTs (e.g. a GRANT of 1800 sec + a DENY of 300 sec = 300 sec timeout value).

You can set these permissions using Import/Export with XML like the following (included in the patch as Portal_Administrators__MAX_INACTIVE.permission as an example):

<permission script="classpath://org/jasig/portal/io/import-permission_v2-6.crn">
<owner>system</owner>
<principal-type>org.jasig.portal.groups.IEntityGroup</principal-type>
<principal>
<group>Portal Administrators</group>
</principal>
<activity>MAX_INACTIVE</activity>
<target>
<literal>3600</literal>
</target>
<permission-type>GRANT</permission-type>
</permission>


Andrew Wills [23/Sep/08 07:35 PM]
Updating patch to use a Servlet Filter per discussions on IRC.

Andrew Wills [23/Sep/08 08:09 PM]
done.