Daniel Frett

NAME

Authen::CAS::UserAgent - CAS-aware LWP::UserAgent

SYNOPSIS

 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');

DESCRIPTION

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.

METHODS

The following methods are available:

$ua->attach_cas_handler( %options )

This method attaches a CAS handler to the current Authen::CAS::UserAgent object.

The following options are supported:

server => $url

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 => $string

This option defines the username to use for authenticating with the CAS server.

This option is required unless using proxy mode.

password => $string

This option defines the password to use for authenticating with the CAS server.

This option is required unless using proxy mode.

restful => $bool

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 => $bool

When this option is TRUE, Authen::CAS::UserAgent using a proxy granting ticket to authenticate with the CAS server.

This option defaults to FALSE.

pgt => $string

This option specifies the proxy granting ticket to use when proxy mode is active.

This option is required when using proxy mode.

strict => $bool

When this option is TRUE, Authen::CAS::UserAgent will only allow authentication for the URL of the request requiring authentication.

This option defaults to FALSE.

callback => $cb

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.

AUTHOR

Daniel Frett

COPYRIGHT AND LICENSE

Copyright 2011-2012 - Campus Crusade for Christ International

This is free software, licensed under:

  The (three-clause) BSD License