Authen::CAS::UserAgent - CAS-aware LWP::UserAgent
use Authen::CAS::UserAgent; my $ua = Authen::CAS::UserAgent->new( 'cas_opts' => { 'server' => 'https://cas.example.com/cas/', 'username' => 'user', 'password' => 'password', 'restful' => 1, }, ); $ua->get('https://www.example.com/casProtectedResource');
This module attempts to add transparent CAS authentication support to LWP::UserAgent. It currently supports using proxy granting tickets, the RESTful API, screen scraping the login screen, or a custom login callback when CAS authentication is required.
The following methods are available:
This method attaches a CAS handler to the current Authen::CAS::UserAgent object.
Authen::CAS::UserAgent
The following options are supported:
server
This option defines the base CAS URL to use for this handler. The base url is used to detect redirects to CAS for authentication and to issue any requests to CAS when authenticating.
This option is required.
username
This option defines the username to use for authenticating with the CAS server.
This option is required unless using proxy mode.
password
This option defines the password to use for authenticating with the CAS server.
restful
When this option is TRUE, Authen::CAS::UserAgent will use the RESTful API to authenticate with the CAS server.
This option defaults to FALSE.
proxy
When this option is TRUE, Authen::CAS::UserAgent using a proxy granting ticket to authenticate with the CAS server.
pgt
This option specifies the proxy granting ticket to use when proxy mode is active.
This option is required when using proxy mode.
strict
When this option is TRUE, Authen::CAS::UserAgent will only allow authentication for the URL of the request requiring authentication.
callback
This option can be used to specify a custom callback to use when authenticating with CAS. The callback is called as follows: $cb->($service, $ua, $handler) and is expected to return a $ticket for the specified service on successful authentication.
Daniel Frett
Copyright 2011-2012 - Campus Crusade for Christ International
This is free software, licensed under:
The (three-clause) BSD License
To install Authen::CAS::UserAgent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Authen::CAS::UserAgent
CPAN shell
perl -MCPAN -e shell install Authen::CAS::UserAgent
For more information on module installation, please visit the detailed CPAN module installation guide.