Apache2-AuthCAS
view release on metacpan or search on metacpan
lib/Apache2/AuthCAS.pm view on Meta::CPAN
"LogLevel" => 0,
"PretendBasicAuth" => 0,
"Service" => undef,
"ProxyService" => undef,
"ErrorUrl" => "http://localhost/cas/error/",
"SessionCleanupThreshold" => 10,
"SessionCookieName" => "APACHECAS",
"SessionCookieDomain" => undef,
"SessionCookieSecure" => 0,
"SessionTimeout" => 1800,
"RemoveTicket" => 0,
"NumProxyTickets" => 0,
"DbDriver" => "Pg",
"DbDataSource" => "dbname=apache_cas;host=localhost;port=5432",
"DbSessionTable" => "cas_sessions",
"DbUser" => "cas",
"DbPass" => "cas",
);
lib/Apache2/AuthCAS.pm view on Meta::CPAN
my($self, $sid) = @_;
# we set up our own session here, so that we don't have to continually
# go through this whole process! we associate a session id with a PGTIOU
# try to get a session record for the session id we received
# session_data - session id, last accessed, netid, pgtiou
if (my($last_accessed, $user, $pgt) = $self->get_session_data($sid))
{
# make sure the session is still valid
if ($last_accessed + $self->casConfig("SessionTimeout") >= time())
{
# session is still valid
$self->logMsg("session '$sid' is still valid", $LOG_DEBUG);
# record the last time the session was accessed
# if something bad happened, like database unavailability
if (!$self->touch_session($sid))
{
return $self->redirect($self->casConfig("ErrorUrl"), $ERROR_CODES{"DB"});
}
lib/Apache2/AuthCAS.pm view on Meta::CPAN
$dbh->disconnect();
return $rc;
}
# delete expired sessions
sub delete_expired_sessions($)
{
my($self) = @_;
my $oldestValidTime = time() - $self->casConfig("SessionTimeout");
$self->logMsg("deleting sessions older than '$oldestValidTime'", $LOG_DEBUG);
# retrieve a session object for this session id
my $dbh = $self->dbConnect() or return 0;
$dbh->do("DELETE FROM " . $self->casConfig("DbSessionTable")
. " WHERE last_accessed < ?"
, undef, $oldestValidTime
);
lib/Apache2/AuthCAS.pm view on Meta::CPAN
# Session cleanup threshold (1 in N requests)
# Session cleanup will occur for each Apache thread or process -
# i.e. for 10 processes, it may take as many as 100 requests before
# session cleanup is performed with a threshold of 10)
CASSessionCleanupThreshold 10
# Session cookie configuration for this service
CASSessionCookieDomain ""
CASSessionCookieName "APACHECAS"
CASSessionTimeout 1800
# Should the ticket parameter be removed from the URL?
CASRemoveTicket 0
# Optional override for this service name
CASService ""
# If you are proxying for a backend service you will need to specify
# these parameters. The service is the name of the backend service
# you are proxying for, the receptor is the URL you will listen at
lib/Apache2/AuthCAS/Configuration.pm view on Meta::CPAN
{ cmd_data => 'LogLevel', err_append => 'uri', },
{ cmd_data => 'PretendBasicAuth', err_append => '0/1', },
{ cmd_data => 'Service', err_append => 'url', },
{ cmd_data => 'ProxyService', err_append => 'url', },
{ cmd_data => 'ErrorUrl', err_append => 'uri', },
{ cmd_data => 'SessionCleanupThreshold', err_append => 'number', },
{ cmd_data => 'SessionCookieName', err_append => 'name', },
{ cmd_data => 'SessionCookieDomain', err_append => 'name', },
{ cmd_data => 'SessionCookieSecure', err_append => '0/1', },
{ cmd_data => 'SessionTimeout', err_append => 'name', },
{ cmd_data => 'RemoveTicket', err_append => '0/1', },
{ cmd_data => 'NumProxyTickets', err_append => 'number', },
{ cmd_data => 'DbDriver', err_append => 'driver', },
{ cmd_data => 'DbDataSource', err_append => 'string', },
{ cmd_data => 'DbSessionTable', err_append => 'session_table', },
{ cmd_data => 'DbUser', err_append => 'username', },
{ cmd_data => 'DbPass', err_append => 'password', },
);
( run in 0.313 second using v1.01-cache-2.11-cpan-4d50c553e7e )