Apache2-AuthCAS
view release on metacpan or search on metacpan
lib/Apache2/AuthCAS.pm view on Meta::CPAN
5556575859606162636465666768697071727374757677
"ProxyUri"
=>
"/cas/proxy"
,
"ProxyValidateUri"
=>
"/cas/proxyValidate"
,
"ServiceValidateUri"
=>
"/cas/serviceValidate"
,
"LogLevel"
=> 0,
"PretendBasicAuth"
=> 0,
"Service"
=>
undef
,
"ProxyService"
=>
undef
,
"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
196197198199200201202203204205206207208209210211212213214215216217218219220221222my
%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
239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272# 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
1045104610471048104910501051105210531054105510561057105810591060106110621063106410651066CASErrorUrl
"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
109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
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
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
lib/Apache2/AuthCAS/Configuration.pm view on Meta::CPAN
2223242526272829303132333435363738394041424344
{
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.317 second using v1.01-cache-2.11-cpan-05444aca049 )