Authen::CAS::External::UserAgent - UserAgent role for CAS session managers.
This documentation refers to Authen::CAS::External::UserAgent version 0.06
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.
/login
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.
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.
POST
This will clear the "previous_response" attribute.
This is an alias to the get method of the "user_agent".
get
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:
cas_url
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.
service
This is a string of the service URL to log in to.
gateway
This is a Boolean of whether or not to use gateway login mode.
renew
This is a Boolean to whether or not to renew the session.
HTML::Form 5.817
HTML::TokeParser 3.00
HTTP::Status 5.817
LWP::UserAgent 5.819
Moose::Role 0.89
MooseX::Types::Moose
MooseX::Types::URI
Scalar::Util 1.14
URI 1.22
URI::QueryParam
namespace::clean 0.04
Douglas Christopher Wilson, <doug at somethingdoug.com>
<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.
bug-authen-cas-external at rt.cpan.org
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:
the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
the Artistic License version 2.0.
To install Authen::CAS::External, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Authen::CAS::External
CPAN shell
perl -MCPAN -e shell install Authen::CAS::External
For more information on module installation, please visit the detailed CPAN module installation guide.