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 anAuthen::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 anAuthen::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 anAuthen::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 anAuthen::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 anAuthen::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 toundef
. - 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 anAuthen::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
COPYRIGHT
Copyright (c) 2007-2009, jason hord
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.