jason hord > Authen-CAS-Client > Authen::CAS::Client::Response

Download:
Authen-CAS-Client-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Authen::CAS::Client::Response - A set of classes for implementing responses from a CAS server

DESCRIPTION ^

Authen::CAS::Client::Response implements a base class that is used to build a hierarchy of response objects that are returned from methods in Authen::CAS::Client. Most response objects are meant to encapsulate a type of response from a CAS server.

CLASSES AND METHODS ^

Authen::CAS::Client::Response

Authen::CAS::Client::Response is the base class from which all other response classes inherit. As such it is very primitive and is never used directly.

new( %args )

new() creates an instance of an Authen::CAS::Client::Response object and assigns its data members according to the values in %args.

is_error()

is_error() returns true if the response represents an error object.

is_failure()

is_failure() returns true if the response represents a failure object.

is_success()

is_success() returns true if the response represents a success object.

doc()

doc() returns the response document used to create the response object. For errors and CAS v1.0 requests this will be the raw text response from the server. Otherwise an XML::LibXML object will be returned. This can be used for debugging or retrieving additional information from the CAS server's response.

Authen::CAS::Client::Response::Error

Authen::CAS::Client::Response::Error is used when an error occurs that prevents further processing of a request. This would include not being able connect to the CAS server, receiving an unexpected response from the server or being unable to correctly parse the server's response according to the guidelines in the CAS protocol specification.

new( error => $error, doc => $doc )

new() creates an instance of an Authen::CAS::Client::Response::Error object. $error is the error string. $doc is the response document.

error()

error() returns the error string.

Authen::CAS::Client::Response::Failure

Authen::CAS::Client::Response::Failure is used as a base class for other failure responses. These correspond to the cas:authenticationFailure and cas:proxyFailure server responses outlined in the CAS protocol specification.

new( code => $code, message => $message, doc => $doc )

new() creates an instance of an Authen::CAS::Client::Response::Failure object. $code is the failure code. $message is the failure message. $doc is the response document.

code()

code() returns the failure code.

message()

message() returns the failure message.

Authen::CAS::Client::Response::AuthFailure

Authen::CAS::Client::Response::AuthFailure is a subclass of Authen::CAS::Client::Response::Failure and is used when a validation attempt fails. When using the CAS v2.0 protocol, $code, $message and $doc are set according to what is parsed from the server response. When using the CAS v1.0 protocol, $code is set to 'V10_AUTH_FAILURE', $message is set to the empty string and $doc is set to the server's response content.

No additional methods are defined.

Authen::CAS::Client::Response::ProxyFailure

Authen::CAS::Client::Response::ProxyFailure is a subclass of Authen::CAS::Client::Response::Failure and is used when a cas:proxyFailure response is received from the CAS server during a proxy attempt. $code, $message and $doc are set according to what is parsed from the server response.

No additional methods are defined.

Authen::CAS::Client::Response::Success

Authen::CAS::Client::Response::Success is used as base class for other success responses. These correspond to the cas:authenticationSuccess and cas:proxySuccess server responses.

new( doc => $doc )

new() creates an instance of an Authen::CAS::Client::Response::Success object. $doc is the response document.

Authen::CAS::Client::Response::AuthSuccess

Authen::CAS::Client::Response::AuthSuccess is a subclass of Authen::CAS::Client::Response::Success and is used when validation succeeds.

new( user => $user, iou => $iou, proxies => \@proxies, doc => $doc )

new() creates an instance of an Authen::CAS::Client::Response::AuthSuccess object. $user is the username received in the response. $iou is the proxy granting ticket IOU, if present. \@proxies is the list of proxies used during validation, if present. $doc is the response document.

user()

user() returns the user name that was contained in the server response.

iou()

iou() returns the proxy granting ticket IOU, if it was present in the server response. Otherwise it is set to undef.

proxies()

proxies() returns the list of proxies present in the server response. If no proxies are found, an empty list is returned. In scalar context an array reference will be returned instead.

Authen::CAS::Client::Response::ProxySuccess

Authen::CAS::Client::Response::ProxySuccess is a subclass of Authen::CAS::Client::Response::Success and is used when a cas:proxySuccess response is received from the CAS server during a proxy attempt.

new( proxy_ticket => $proxy_ticket, doc => $doc )

new() creates an instance of an Authen::CAS::Client::Response::ProxySuccess object. $proxy_ticket is the proxy ticket received in the response. $doc is the response document.

proxy_ticket()

proxy_ticket() returns the proxy ticket that was contained in the server response.

BUGS ^

None are known at this time, but if you find one, please feel free to submit a report to the author.

AUTHOR ^

jason hord <pravus@cpan.org>

SEE ALSO ^

Authen::CAS::Client

COPYRIGHT ^

Copyright (c) 2007-2014, jason hord

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

syntax highlighting: