|
NAMEAuthCAS - Client library for JA-SIG CAS 2.0 authentication serverVERSIONVersion 1.6DESCRIPTIONAuthCAS aims at providing a Perl API to JA-SIG Central Authentication System (CAS). Only a basic Perl library is provided with CAS whereas AuthCAS is a full object-oriented library.PREREQUISITESThis script requires IO::Socket::SSL and LWP::UserAgentSYNOPSISA simple example with a direct CAS authentication use AuthCAS; my $cas = new AuthCAS(casUrl => 'https://cas.myserver, CAFile => '/etc/httpd/conf/ssl.crt/ca-bundle.crt', ); my $login_url = $cas->getServerLoginURL('http://myserver/app.cgi'); ## The user should be redirected to the $login_url ## When coming back from the CAS server a ticket is provided in the QUERY_STRING ## $ST should contain the receaved Service Ticket my $user = $cas->validateST('http://myserver/app.cgi', $ST); printf "User authenticated as %s\n", $user; In the following example a proxy is requesting a Proxy Ticket for the target application $cas->proxyMode(pgtFile => '/tmp/pgt.txt', pgtCallbackUrl => 'https://myserver/proxy.cgi?callback=1 ); ## Same as before but the URL is the proxy URL my $login_url = $cas->getServerLoginURL('http://myserver/proxy.cgi'); ## Like in the previous example we should receave a $ST my $user = $cas->validateST('http://myserver/proxy.cgi', $ST); ## Process errors printf STDERR "Error: %s\n", &AuthCAS::get_errors() unless (defined $user); ## Now we request a Proxy Ticket for the target application my $PT = $cas->retrievePT('http://myserver/app.cgi'); ## This piece of code is executed by the target application ## It received a Proxy Ticket from the proxy my ($user, @proxies) = $cas->validatePT('http://myserver/app.cgi', $PT); printf "User authenticated as %s via %s proxies\n", $user, join(',',@proxies); DESCRIPTIONJasig CAS is Yale University's web authentication system, heavily inspired by Kerberos. Release 2.0 of CAS provides "proxied credential" feature that allows authentication tickets to be carried by intermediate applications (Portals for instance), they are called proxy.This AuthCAS Perl module provides required subroutines to validate and retrieve CAS tickets. newmy $cas = new AuthCAS( casUrl => 'https://cas.myserver', CAFile => '/etc/httpd/conf/ssl.crt/ca-bundle.crt', ); The "new" constructor lets you create a new AuthCAS object.
Returns a new AuthCAS or dies on error. get_errorsReturn module errorsproxyModeUse the CAS object as a proxy
dump_vargetServerLoginURL($service)Returns a URL that you can redirect the browser to, which includes the URL to return toTODO: it escapes the return URL, but I've noticed some issues with more complicated URL's getServerLoginGatewayURL($service)Returns non-blocking login URL ie: if user is logged in, return the ticket, otherwise do not prompt for logingetServerLogoutURL($service)Return logout URL After logout user is redirected back to the applicationgetServerServiceValidateURL($service, $ticket, $pgtUrl)ReturnsgetServerProxyURL($targetService, $pgt)ReturnsgetServerProxyValidateURL($service, $ticket)ReturnsvalidateST($service, $ticket)Validate a Service Ticket Also used to get a PGTReturns the login that created the ticket, if the ticket is valid for that $service URL returns undef if the ticket is not valid. validatePT($service, $ticket)Validate a Proxy TicketReturns the login that created the ticket, if the ticket is valid for that $service URL, and a list of Proxies used. user returned == undef if its not a valid ticket callCAS($url)## Access a CAS URL and parses received XMLReturns storePGT($pgtIou, $pgtId)retrievePT($service)Returnsget_https2request a document using https, return status and contentSven suspects this is intended to be private. Returns SEE ALSOJA-SIG Central Authentication Service <http://www.jasig.org/cas>was Yale Central Authentication Service <http://www.yale.edu/tp/auth/> phpCAS <http://esup-phpcas.sourceforge.net/> COPYRIGHTCopyright (C) 2003, 2005,2006,2007,2009 Olivier Salaun - Comité Réseau des Universités <http://www.cru.fr> 2012 Sven Dowideit - <mailto:SvenDowideit@fosiki.com>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHORSOlivier Salaun Sven Dowideit POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |