
marshall at exclupen
Oct 15, 2008, 8:51 AM
Post #8 of 9
(2550 views)
Permalink
|
On Oct 15, 2008, at 11:22 AM, Matt Rolf wrote: > > On Oct 14, 2008, at 1:56 PM, Marshall Roch wrote: > >> Could you write a module for Bricolage that works with any Apache >> auth mechanism? Then you could use mod_auth_cas through Bricolage's >> httpd. > > I've been doing some more thinking on this. Marshall, how would > you suggest approaching it? Is there a perl module out there that > you would recommend as a starting point? Most of the ones I'm > finding seem to be for specific auth mechanisms. I haven't actually done it with Perl or mod_auth_cas, but I have with Rails and mod_pubcookie. Basically, mod_pubcookie intercepts the request at the Apache level (before mod_perl or Bricolage or anything else) and handles the SSO, sending you off to a login server if you're not logged in. Then you're returned to the page with a cookie that mod_pubcookie uses to authenticate you. So when the request gets to mod_perl, the REMOTE_USER environment variable contains the authenticated user's username. You can always trust REMOTE_USER. I'm not sure how mod_auth_cas works, but I'm guessing it's somehow similar in that you wouldn't ever need to use the Bricolage login page. So if REMOTE_USER is set by Apache, then you can just call set_user() and create the session. Looks like you'd probably want to add it directly to Bric::App::Auth::auth() rather than a separate auth plugin. -- Marshall
|