[Building Sakai] Access to HTTP Session Data

Mark J. Norton markjnorton at earthlink.net
Fri Jan 3 06:55:46 PST 2014


I am still working on accessing identity parameters set by Shibboleth in 
the HTTP request to Sakai.  The idea is to pick up these attributes in a 
custom User Directory Provider (UDP).  Various approaches have not 
worked so far.  These attributes do not seem to be present in the Sakai 
session, servlet context, or servlet request by the time the UDP is called.

I've been reading the Sakai Request Filter 
<https://source.sakaiproject.org/svn/kernel/trunk/api/src/main/java/org/sakaiproject/util/RequestFilter.java> 
code.  There is a protected variable called m_sakaiHttpSession, which is 
initialized from the FilterConfig passed into the init() method.  It has 
four "levels":

  * CONTAINER_SESSION = 0;    // don't do anything.
  * SAKAI_SESSION = 1;             // use the sakai wide session.
  * CONTEXT_SESSION = 2;       // use the context session.
  * TOOL_SESSION = 3;              // use the tool session, in any, else
    context.

Looking at the web.xml 
<https://source.sakaiproject.org/svn/portal/trunk/portal-tool/tool/src/webapp/WEB-INF/web.xml> 
file for the Portal, I note that the "http.session" init parameter is 
not specified, thus defaulting to TOOL_SESSION.

My question is this.  If I add an init-param XML block to specify the 
HTTP Session at SAKIA_SESSION, for example, will it screw up all of 
Sakai?  For example:

    <init-param>
                 <param-name>http.session</param-name>
                 <param-value>1</param-value>
    </init-param>

My concern is that by shifting the HTTP Session into the Sakai Session 
(or Servlet Context, etc), that it would be missing in the Tool Session, 
where tools expect it to be.  I'm willing to just try this and see what 
happens, but I though it would be useful to give someone the chance to 
say, "Don't do that!  Are you crazy!?!".

- Mark Norton




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140103/3b9b64cc/attachment.html 


More information about the sakai-dev mailing list