[LON-CAPA-dev] Environment variables

Stuart Raeburn raeburn at msu.edu
Thu Jan 30 07:44:58 EST 2014


Christian,

Thanks for following up on the earlier thread in the lon-capa-admin  
list (e.g.,  
http://mail.lon-capa.org/pipermail/lon-capa-admin/2014-January/002786.html)   
with a post to the lon-capa-dev list.

The lon-capa-dev list is a more appropriate venue for this discussion.

>    Will those variables placed into the environment only in
>    particular circumstances?

Shibboleth environment variables in %ENV are available in mod_perl at  
the PerlHandler phase (i.e., createaccount.pm), but not in the earlier  
TransHandler (lontrans.pm) AccesHandler (publiccheck.pm),  
AuthenHandler (lonshibauth.pm) and AuthzHandler (lonshibacc.pm,  
lonacc.pm) phases.

> So, right now I believe that I won't get those variables in any handler
> because it has to be a directly called cgi script.

That is not correct. However, some changes were needed to lonacc.pm  
and createaccount.pm (see below) to make the Shibboleth environment  
variables accessible in createaccount.pm

>   Would it be a suitable respectively recommended approach to
>   catch those variables by a direct call of such a cgi script,
>   save/populate those variables in the environment manually and
>   redirect/go on with the standard LON-CAPA processing?
>

No, that would not be a desirable approach.

> Many questions, hopefully anyone has some answers and the time for
> telling me them.

As it turns out, I am currently doing some work on createaccount.pm  
(for bug 6646), so I will be able to fold the minor changes needed to  
support retrieval of Shibboleth environment variables containing user  
information (and their use when creating a new LON-CAPA account for an  
institutionally authenticated user -- Shibboleth SSO), into my current  
work.

I will be including an additional domain configuration to allow  
domains to specify which Shibboleth-supplied variables in %ENV map to  
which LON-CAPA user data fields.  These changes are of sufficiently  
limited scope that I can also roll them into the forthcoming 2.11.0

So far I have committed createaccount.pm rev 1.57, and lonacc.pm 1.153  
(see:  
http://mail.lon-capa.org/pipermail/lon-capa-cvs/Week-of-Mon-20140127/025691.html ) to provide access to the Shibboleth environment variables when creating a new LON-CAPA user  
account.


Stuart Raeburn
LON-CAPA Academic Consortium


Quoting Christian K
nieling <knieling at kit.edu>:

> Hi everybody,
>
> I have a question for the experienced web developers.
>
> My goal is to capture environment variables within LON-CAPA. Those
> variables should be/get delivered by a Shibboleth identity provider on
> successful authentication.
>
> So, my questions are.
>
>    Will those variables placed into the environment only in
>    particular circumstances?
>
> What I mean is, I find those variables in the case of calling a cgi
> script but I don't find them when I search for them in any handler that
> I tested so far such as "Apache::lontrans", "Apache::lonshibauth",
> "Apache::lonshibacc", "Apache::lonacc" or "Apache::createaccount".
>
> So, right now I believe that I won't get those variables in any handler
> because it has to be a directly called cgi script.
>
>   Am I wrong with this assumption and I just tested the wrong
>   handlers?
>   Or can anyone confirm this assumption and behavior?
>
> When I'm right with this assumption:
>
>   Would it be a suitable respectively recommended approach to
>   catch those variables by a direct call of such a cgi script,
>   save/populate those variables in the environment manually and
>   redirect/go on with the standard LON-CAPA processing?
>
> Or to question the other way around:
>
>   Would have had a patch with this above approach a chance to get
>   into a release?
>
> Many questions, hopefully anyone has some answers and the time for
> telling me them.
>
> Thanks for reading so far ;)
> Christian




More information about the LON-CAPA-dev mailing list