Authen::CAS::External::Response - Response from CAS interaction.
This documentation refers to Authen::CAS::External::Response version 0.06
my $response = $cas_external->authenticate; if (!$response->is_success) { croak 'Authentication failed'; } # Get a PHP Session cookie my %cookies = $response->get_cookies('PHPSESSID'); my $PHP_SESSION_ID = $cookies{PHPSESSID}; # Continue the request $response = $ua->get($response->destination);
This module is rarely created by anything other than Authen::CAS::External::UserAgent. This is an object that is provided to make determining what the CAS response was easier.
This contains a URI object that is the URL to the destination service after authentication. This means that by going to this URL, the client should be at the service fully authenticated. Use "has_destination" to determine if the response has a destination address.
if ($response->has_destination) { my $service_page = $user_agent->get($response->destination); }
Added in version 0.05; be sure to require this version for this feature.
This contains a string with a notification for the user from the CAS server. This is usually not set, but can be if the server uses something which tells the user their password is going to expire.
if ($response->has_notification) { warn $response->notification; }
This contains a HTTP::Response object that is the response that occurred right before the user agent would have left the CAS site. This would be useful for custom parsing of the response. Use "has_response" to determine if the response has a response.
This contains a URI object that is the URL of the service. This would typically be the host and path part of the destination service. Use "has_service" to determine if the response has a service.
This is the service ticket that has been granted for the service. Use "has_service_ticket" to determine if the response has a service ticket.
This is the ticket granting cookie that has been given to the user agent to allow for re-authentication with the CAS service in the future without providing a username and password. Use "has_ticket_granting_cookie" to determine if the response has a ticket granting cookie.
This method is for convenience purposes. Using this method, a HEAD request will be made to the destination URL and will return a hash of the cookie names and their values that would have been set.
get_cookies()
When no arguments are provided, returns a string of the cookies, using the as_string method of HTTP::Cookie.
get_cookies(@list_of_cookie_names)
When given a list of cookie names, a hash is returned with only those cookies where the cookie name is the key and the value is the value.
Returns a Boolean of whether or not the response has an associated "destination".
Returns a Boolean of whether or not the response has an associated "notification".
Returns a Boolean of whether or not the response has an associated "response".
Returns a Boolean of whether or not the response has an associated "service".
Returns a Boolean of whether or not the response has an associated "service_ticket".
Returns a Boolean of whether or not the response has an associated "ticket_granting_cookie".
Returns a Boolean of whether or not this response indicates a successful authentication.
LWP::UserAgent 5.819
Moose 0.89
MooseX::StrictConstructor 0.08
URI 1.22
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.