Apache2-AuthCAS
view release on metacpan or search on metacpan
lib/Apache2/AuthCAS.pm view on Meta::CPAN
"ProxyUri" => "/cas/proxy",
"ProxyValidateUri" => "/cas/proxyValidate",
"ServiceValidateUri" => "/cas/serviceValidate",
"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 %params = $self->parse_query_parameters($uri->query);
# Check for a proxy receptor call
if ($params{'pgt'} and $params{'pgtIou'})
{
return $self->proxy_receptor($params{'pgtIou'}, $params{'pgt'});
}
# Check for a session cookie
if (my $cookie = $r->headers_in->{'Cookie'})
{
# we have a session cookie, so we need to get the session id
$self->logMsg("cookie found: '$cookie'", $LOG_DEBUG);
# get session id from the cookie
my $cookieName = $self->casConfig("SessionCookieName");
$cookie =~ /.*$cookieName=([^;]+)(\s*;.*|\s*$)/;
my $sid = $1;
$self->logMsg(($sid ? "" : "no") . " session id found", $LOG_DEBUG);
# Check for a valid session id
if ($sid and defined(my $rc = $self->check_session($sid)))
{
return $rc;
}
}
lib/Apache2/AuthCAS.pm view on Meta::CPAN
# map a new session id to this pgtiou and give the client a cookie
my $sid = $self->create_session($user, $pgtiou, $ticket);
if (!$sid)
{
# if something bad happened, like database unavailability
return $self->redirect($self->casConfig("ErrorUrl"), $ERROR_CODES{"DB"});
}
my $cookie = $self->casConfig("SessionCookieName") . "=$sid;path=/";
if ($self->casConfig("SessionCookieDomain"))
{
$cookie .= ";domain=." . $self->casConfig("SessionCookieDomain");
}
if ($self->casConfig("SessionCookieSecure"))
{
$cookie .= ";secure";
}
# send the cookie to the browser
$self->setHeader(0, 'Set-Cookie', $cookie);
# in case we redirect (considered an "error")
$r->err_headers_out->{"Set-Cookie"} = $cookie;
if ($self->casConfig("ProxyService"))
{
return $self->do_proxy($sid, undef, $user, 1);
}
else
{
$self->setHeader(1, 'CAS_FILTER_USER', $user);
$self->add_basic_auth($user);
lib/Apache2/AuthCAS.pm view on Meta::CPAN
CASErrorUrl "http://localhost/cas/error/"
# 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
lib/Apache2/AuthCAS.pm view on Meta::CPAN
last_accessed int8 not null,
user_id varchar(32) not null,
pgtiou varchar(256),
pgt varchar(256)
service_ticket varchar(256)
);
Add indexes and adjust as appropriate for your database and usage.
SSL
Be careful not to use the CASSessionCookieSecure flag with an HTTP resource.
If this flag is set and the protocol is HTTP, then no cookie will get sent
to Apache and Apache2::AuthCAS may act very strange.
Be sure to set CASSessionCookieSecure only on HTTPS resources!
=head1 COMPATIBILITY
This module will only work with mod_perl2. mod_perl1 is not supported.
=head1 SEE ALSO
=head2 Official JA-SIG CAS Website
http://www.ja-sig.org/products/cas/
lib/Apache2/AuthCAS/Configuration.pm view on Meta::CPAN
{ cmd_data => 'ProxyUri', err_append => 'uri', },
{ cmd_data => 'ProxyValidateUri', err_append => 'uri', },
{ cmd_data => 'ServiceValidateUri', err_append => 'url', },
{ 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.391 second using v1.01-cache-2.11-cpan-05444aca049 )