
Authen::CAS::External::UserAgent - UserAgent role for CAS session managers.

This documentation refers to version 0.08.

package MyCAS::Session;
use Moose;
# Use this role
with 'Authen::CAS::External::UserAgent';
sub get_cas_credentials {
my ($self, $service) = @_;
# Do something
return $username, $password;
}
sub get_cas_ticket_granting_cookie {
my ($self, $username, $service) = @_;
# Do something
return $TGC;
}
1;

Provides a way to authenticate with a CAS server just as a browser would. This is useful with web scrapers needing to login to a CAS site.

This is a Moose::Role and for this role to be used, the user MUST provide the following two methods:
This is called as a method with the first argument being a string that is the URL of the service that is about to be logged in to. If no service is being logged in to, then it will be undefined. This function is expected to return a username string and a password string, both of which are optional, but MUST be returned in that order.
This is called as a method with the first argument being a string that is the username being used and the second argument being a string that is the URL of the service that is about to be logged into. This function is expected to return a string that is the ticket granting cookie for the CAS service, or nothing.

This is a URI object of the base URL of the CAS site. This is typically the path before /login. A string may be supplied and will automatically be converted to a URI object.
This holds the response object Authen::CAS::External::Response from the last executed CAS navigation.
This is a Boolean that determines if the "user_agent" will navigate outside of the "cas_url". The default is 0.
This is a LWP::UserAgent that is used to navigate the CAS site. The default is LWP::UserAgent with an in-memory cookie jar and allows the POST method to be redirectable.

This will clear the "previous_response" attribute.
This is an alias to the get method of the "user_agent".
This will return if there is a value present in the "previous_response" attribute.
service_request_url(%args)
This method will return a URI object that is the URL to request for the CAS login page. All arguments are optional. The following are the possible arguments:
Added in version 0.06; be sure to require this version for this feature.
This is the URL of the CAS deployment to use. By default this will use the "cas_url" attribute. This can be either a URI object or a string.
This is a string of the service URL to log in to.
This is a Boolean of whether or not to use gateway login mode.
This is a Boolean to whether or not to renew the session.


Douglas Christopher Wilson, <doug at somethingdoug.com>

Please report any bugs or feature requests to bug-authen-cas-external at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Authen-CAS-External. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
I highly encourage the submission of bugs and enhancements to my modules.

Copyright 2009 Douglas Christopher Wilson.
This program is free software; you can redistribute it and/or modify it under the terms of either: