phpCAS version 1.3.6

Functions | Variables
Miscellaneous
Implementation

## Functions
| CAS_Client::_readURL ($url, &$headers, &$body, &$err_msg)
| CAS_Client::_buildSAMLPayload ()
| CAS_Client::setURL ($url)
| CAS_Client::getURL ()
| CAS_Client::setBaseURL ($url)
| CAS_Client::_getClientUrl ()
| CAS_Client::_isHttps ()
| CAS_Client::_removeParameterFromQueryString ($parameterName, $queryString)
| CAS_Client::_buildQueryUrl ($url, $query)
| CAS_Client::_renameSession ($ticket)
| CAS_Client::_sessionIdForTicket ($ticket)
| CAS_Client::setSessionIdSalt ($salt)
| CAS_Client::_authError ( $failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='')
| CAS_Client::_getNodeType ($nodeURL)
| CAS_Client::addRebroadcastNode ($rebroadcastNodeUrl)
| CAS_Client::addRebroadcastHeader ($header)
| CAS_Client::_rebroadcast ($type)

## Variables
| CAS_Client::$_url
| CAS_Client::$_sessionIdSalt = ''
| CAS_Client::$_rebroadcast = false
| CAS_Client::$_rebroadcast_nodes = array()
const | CAS_Client::HOSTNAME = 0
const | CAS_Client::IP = 1
| CAS_Client::$_rebroadcast_headers = array()
const | CAS_Client::LOGOUT = 0
const | CAS_Client::PGTIOU = 1

## Detailed Description

## Function Documentation

## ◆ _authError()

CAS_Client::_authError | ( |  | $failure,
|  |  | $cas_url,
|  |  | $no_response,
|  |  | $bad_response = `''`,
|  |  | $cas_response = `''`,
|  |  | $err_code = `''`,
|  |  | $err_msg = `''`
| ) |  |
| private

This method is used to print the HTML output when the user was not authenticated.

Parameters

  string | $failure | the failure that occured
  string | $cas_url | the URL the CAS server was asked for
  bool | $no_response | the response from the CAS server (other parameters are ignored if true)
  bool | $bad_response | bad response from the CAS server ($err_code and $err_msg ignored if true)
  string | $cas_response | the response of the CAS server
  int | $err_code | the error code given by the CAS server
  string | $err_msg | the error message given by the CAS server

Returns
  void

Definition at line 3759 of file Client.php.

References $cas_url, CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, CAS_Client\getLangObj(), CAS_Client\getServerVersion(), CAS_Client\getURL(), CAS_Client\printHTMLFooter(), CAS_Client\printHTMLHeader(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().

## ◆ _buildQueryUrl()

CAS_Client::_buildQueryUrl | ( |  | $url,
|  |  | $query
| ) |  |
| private

This method is used to append query parameters to an url. Since the url might already contain parameter it has to be detected and to build a proper URL

Parameters

  string | $url | base url to add the query params to
  string | $query | params in query form with & separated

Returns
  url with query params

Definition at line 3662 of file Client.php.

Referenced by CAS_Client\getServerLoginURL(), CAS_Client\getServerProxyValidateURL(), CAS_Client\getServerSamlValidateURL(), and CAS_Client\getServerServiceValidateURL().

## ◆ _buildSAMLPayload()

CAS_Client::_buildSAMLPayload | ( |  | ) |
| private

This method is used to build the SAML POST body sent to /samlValidate URL.

Returns
  the SOAP-encased SAMLP artifact (the ticket).

Definition at line 2845 of file Client.php.

References CAS_Client\getTicket(), SAML_SOAP_ENV, phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_readURL().

## ◆ _getClientUrl()

CAS_Client::_getClientUrl | ( |  | ) |
| private

Try to figure out the phpCas client URL with possible Proxys / Ports etc.

Returns
  string Server URL with domain:port

Definition at line 3577 of file Client.php.

References CAS_Client\_isHttps().

Referenced by CAS_Client\_getCallbackURL(), and CAS_Client\getURL().

## ◆ _getNodeType()

CAS_Client::_getNodeType | ( |  | $nodeURL | ) |
| private

Determine the node type from the URL.

Parameters

  String | $nodeURL | The node URL.

Returns
  string hostname

Definition at line 3831 of file Client.php.

References phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_rebroadcast().

## ◆ _isHttps()

CAS_Client::_isHttps | ( |  | ) |
| private

This method checks to see if the request is secured via HTTPS

Returns
  bool true if https, false otherwise

Definition at line 3617 of file Client.php.

Referenced by CAS_Client\__construct(), CAS_Client\_getClientUrl(), and CAS_Client\getURL().

## ◆ _readURL()

CAS_Client::_readURL | ( |  | $url,
|  | & | $headers,
|  | & | $body,
|  | & | $err_msg
| ) |  |
| private

This method is used to acces a remote URL.

Parameters

  string | $url | the URL to access.
  string | &$headers | an array containing the HTTP header lines of the response (an empty array on failure).
  string | &$body | the body of the response, as a string (empty on failure).
  string | &$err_msg | an error message, filled on failure.

Returns
  true on success, false otherwise (in this later case, $err_msg contains an error message).

Definition at line 2790 of file Client.php.

References CAS_Client\$_requestImplementation, CAS_Client\_buildSAMLPayload(), phpCAS\error(), CAS_Client\getServerVersion(), SAML_VERSION_1_1, phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\retrievePT(), CAS_Client\validateCAS10(), and CAS_Client\validateCAS20().

## ◆ _rebroadcast()

CAS_Client::_rebroadcast | ( |  | $type | ) |
| private

This method rebroadcasts logout/pgtIou requests. Can be LOGOUT,PGTIOU

Parameters

  int | $type | type of rebroadcasting.

Returns
  void

Definition at line 3895 of file Client.php.

References CAS_Client\$_rebroadcast_nodes, CAS_Client\$_requestImplementation, CAS_Client\_getNodeType(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_wasPreviouslyAuthenticated(), CAS_Client\addRebroadcastNode(), and CAS_Client\handleLogoutRequests().

## ◆ _removeParameterFromQueryString()

CAS_Client::_removeParameterFromQueryString | ( |  | $parameterName,
|  |  | $queryString
| ) |  |
| private

Removes a parameter from a query string

Parameters

  string | $parameterName | name of parameter
  string | $queryString | query string

Returns
  string new query string

http://stackoverflow.com/questions/1842681/regular-expression-to-remove-one-parameter-from-query-string

Definition at line 3643 of file Client.php.

Referenced by CAS_Client\getURL().

## ◆ _renameSession()

CAS_Client::_renameSession | ( |  | $ticket | ) |
| private

Renaming the session

Parameters

  string | $ticket | name of the ticket

Returns
  void

Definition at line 3676 of file Client.php.

References CAS_Client\_sessionIdForTicket(), CAS_Client\getChangeSessionID(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\validateSA().

## ◆ _sessionIdForTicket()

CAS_Client::_sessionIdForTicket | ( |  | $ticket | ) |
| private

Answer a valid session-id given a CAS ticket.

The output must be deterministic to allow single-log-out when presented with the ticket to log-out.

Parameters

  string | $ticket | name of the ticket

Returns
  string

Definition at line 3715 of file Client.php.

Referenced by CAS_Client\_renameSession(), and CAS_Client\handleLogoutRequests().

## ◆ addRebroadcastHeader()

CAS_Client::addRebroadcastHeader | ( |  | $header | ) |

This method is used to add header parameters when rebroadcasting pgtIou/pgtId or logoutRequest.

Parameters

  string | $header | Header to send when rebroadcasting.

Returns
  void

Definition at line 3874 of file Client.php.

## ◆ addRebroadcastNode()

CAS_Client::addRebroadcastNode | ( |  | $rebroadcastNodeUrl | ) |

Store the rebroadcast node for pgtIou/pgtId and logout requests.

Parameters

  string | $rebroadcastNodeUrl | The rebroadcast node URL.

Returns
  void

Definition at line 3850 of file Client.php.

References CAS_Client\_rebroadcast().

## ◆ getURL()

CAS_Client::getURL | ( |  | ) |

This method returns the URL of the current request (without any ticket CGI parameter).

Returns
  The URL

Definition at line 3524 of file Client.php.

References CAS_Client\$_url, CAS_Client\_getClientUrl(), CAS_Client\_isHttps(), CAS_Client\_removeParameterFromQueryString(), CAS_Client\setURL(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_authError(), CAS_Client\getServerLoginURL(), CAS_Client\getServerProxyValidateURL(), CAS_Client\getServerSamlValidateURL(), CAS_Client\getServerServiceValidateURL(), and CAS_Client\isAuthenticated().

## ◆ setBaseURL()

CAS_Client::setBaseURL | ( |  | $url | ) |

This method sets the base URL of the CAS server.

Parameters

  string | $url | the base URL

Returns
  string base url

Definition at line 3562 of file Client.php.

## ◆ setSessionIdSalt()

CAS_Client::setSessionIdSalt | ( |  | $salt | ) |

Set a salt/seed for the session-id hash to make it harder to guess.

Parameters

  string | $salt |

Returns
  void

Definition at line 3736 of file Client.php.

## ◆ setURL()

CAS_Client::setURL | ( |  | $url | ) |

This method sets the URL of the current request

Parameters

  string | $url | url to set for service

Returns
  void

Definition at line 3509 of file Client.php.

Referenced by CAS_Client\getURL().

## Variable Documentation

## ◆ $_rebroadcast

CAS_Client::$_rebroadcast = false
| private

Boolean of whether to rebroadcast pgtIou/pgtId and logoutRequest, and array of the nodes.

Definition at line 3814 of file Client.php.

## ◆ $_rebroadcast_headers

CAS_Client::$_rebroadcast_headers = array()
| private

An array to store extra rebroadcast curl options.

Definition at line 3864 of file Client.php.

## ◆ $_rebroadcast_nodes

CAS_Client::$_rebroadcast_nodes = array()
| private

Definition at line 3815 of file Client.php.

Referenced by CAS_Client\_rebroadcast().

## ◆ $_sessionIdSalt

string CAS_Client::$_sessionIdSalt = ''
| private

Set a salt/seed for the session-id hash to make it harder to guess.

Definition at line 3727 of file Client.php.

## ◆ $_url

CAS_Client::$_url
| private

the URL of the current request (without any ticket CGI parameter). Written and read by CAS_Client::getURL().

Definition at line 3499 of file Client.php.

Referenced by CAS_Client\getURL().

## ◆ HOSTNAME

const CAS_Client::HOSTNAME = 0

Constants used for determining rebroadcast node type.

Definition at line 3820 of file Client.php.

## ◆ IP

const CAS_Client::IP = 1

Definition at line 3821 of file Client.php.

## ◆ LOGOUT

const CAS_Client::LOGOUT = 0

Constants used for determining rebroadcast type (logout or pgtIou/pgtId).

Definition at line 3885 of file Client.php.

## ◆ PGTIOU

const CAS_Client::PGTIOU = 1

Definition at line 3886 of file Client.php.