Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Licensed to Jasig under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Jasig licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

Author: Pascal Aubry <pascal.aubry@univ-rennes1.fr>
Author: Olivier Berger <olivier.berger@it-sudparis.eu>
Author: Brett Bieber <brett.bieber@gmail.com>
Author: Joachim Fritschi <jfritschi@freenet.de>
Author: Adam Franco <afranco@middlebury.edu>
License: http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
File Size: 4004 lines (141 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CAS_Client:: (115 methods):
  _htmlFilterOutput()
  printHTMLHeader()
  printHTMLFooter()
  setHTMLHeader()
  setHTMLFooter()
  setLang()
  getLangObj()
  getServerVersion()
  _getServerHostname()
  _getServerPort()
  _getServerURI()
  _getServerBaseURL()
  getServerLoginURL()
  setServerLoginURL()
  setServerServiceValidateURL()
  setServerProxyValidateURL()
  setServerSamlValidateURL()
  getServerServiceValidateURL()
  getServerSamlValidateURL()
  getServerProxyValidateURL()
  getServerProxyURL()
  getServerLogoutURL()
  setServerLogoutURL()
  setExtraCurlOption()
  setRequestImplementation()
  setNoClearTicketsFromUrl()
  setCasAttributeParserCallback()
  setPostAuthenticateCallback()
  setSingleSignoutCallback()
  ensureIsProxy()
  markAuthenticationCall()
  wasAuthenticationCalled()
  _ensureAuthenticationCalled()
  wasAuthenticationCallSuccessful()
  ensureAuthenticationCallSuccessful()
  getAuthenticationCallerFile()
  getAuthenticationCallerLine()
  getAuthenticationCallerMethod()
  __construct()
  _setChangeSessionID()
  getChangeSessionID()
  _setUser()
  getUser()
  _getUser()
  setAttributes()
  getAttributes()
  hasAttributes()
  hasAttribute()
  _hasAttribute()
  getAttribute()
  renewAuthentication()
  forceAuthentication()
  setCacheTimesForAuthRecheck()
  checkAuthentication()
  isAuthenticated()
  isSessionAuthenticated()
  _wasPreviouslyAuthenticated()
  redirectToCas()
  logout()
  _isLogoutRequest()
  handleLogoutRequests()
  getTicket()
  setTicket()
  hasTicket()
  setCasServerCACert()
  setNoCasServerValidation()
  validateCAS10()
  validateSA()
  _setSessionAttributes()
  isProxy()
  _getPGT()
  _setPGT()
  _hasPGT()
  _setCallbackMode()
  _isCallbackMode()
  _setCallbackModeUsingPost()
  _isCallbackModeUsingPost()
  _getCallbackURL()
  setCallbackURL()
  _callback()
  _initPGTStorage()
  _storePGT()
  _loadPGT()
  setPGTStorage()
  setPGTStorageDb()
  setPGTStorageFile()
  _validatePGT()
  retrievePT()
  _readURL()
  _buildSAMLPayload()
  getProxiedService()
  initializeProxiedService()
  serviceWeb()
  serviceMail()
  getProxies()
  _setProxies()
  getAllowedProxyChains()
  validateCAS20()
  _readExtraAttributesCas20()
  _addAttributeToArray()
  setURL()
  getURL()
  setBaseURL()
  _getClientUrl()
  _isHttps()
  _removeParameterFromQueryString()
  _buildQueryUrl()
  _renameSession()
  _sessionIdForTicket()
  setSessionIdSalt()
  _authError()
  _getNodeType()
  addRebroadcastNode()
  addRebroadcastHeader()
  _rebroadcast()


Class: CAS_Client  - X-Ref

The CAS_Client class is a client interface that provides CAS authentication
to PHP applications.

_htmlFilterOutput($str)   X-Ref
This method filters a string by replacing special tokens by appropriate values
and prints it. The corresponding tokens are taken into account:
- __CAS_VERSION__
- __PHPCAS_VERSION__
- __SERVER_BASE_URL__

Used by CAS_Client::PrintHTMLHeader() and CAS_Client::printHTMLFooter().

param: string $str the string to filter and output
return: void

printHTMLHeader($title)   X-Ref
This method prints the header of the HTML output (after filtering). If
CAS_Client::setHTMLHeader() was not used, a default header is output.

param: string $title the title of the page
return: void

printHTMLFooter()   X-Ref
This method prints the footer of the HTML output (after filtering). If
CAS_Client::setHTMLFooter() was not used, a default footer is output.

return: void

setHTMLHeader($header)   X-Ref
This method set the HTML header used for all outputs.

param: string $header the HTML header.
return: void

setHTMLFooter($footer)   X-Ref
This method set the HTML footer used for all outputs.

param: string $footer the HTML footer.
return: void

setLang($lang)   X-Ref
This method is used to set the language used by phpCAS.

param: string $lang representing the language.
return: void

getLangObj()   X-Ref
Create the language

return: CAS_Languages_LanguageInterface object implementing the class

getServerVersion()   X-Ref
This method is used to retrieve the version of the CAS server.

return: string the version of the CAS server.

_getServerHostname()   X-Ref
This method is used to retrieve the hostname of the CAS server.

return: string the hostname of the CAS server.

_getServerPort()   X-Ref
This method is used to retrieve the port of the CAS server.

return: int the port of the CAS server.

_getServerURI()   X-Ref
This method is used to retrieve the URI of the CAS server.

return: string a URI.

_getServerBaseURL()   X-Ref
This method is used to retrieve the base URL of the CAS server.

return: string a URL.

getServerLoginURL($gateway=false,$renew=false)   X-Ref
This method is used to retrieve the login URL of the CAS server.

param: bool $gateway true to check authentication, false to force it
param: bool $renew   true to force the authentication with the CAS server
return: string a URL.

setServerLoginURL($url)   X-Ref
This method sets the login URL of the CAS server.

param: string $url the login URL
return: string login url

setServerServiceValidateURL($url)   X-Ref
This method sets the serviceValidate URL of the CAS server.

param: string $url the serviceValidate URL
return: string serviceValidate URL

setServerProxyValidateURL($url)   X-Ref
This method sets the proxyValidate URL of the CAS server.

param: string $url the proxyValidate URL
return: string proxyValidate URL

setServerSamlValidateURL($url)   X-Ref
This method sets the samlValidate URL of the CAS server.

param: string $url the samlValidate URL
return: string samlValidate URL

getServerServiceValidateURL()   X-Ref
This method is used to retrieve the service validating URL of the CAS server.

return: string serviceValidate URL.

getServerSamlValidateURL()   X-Ref
This method is used to retrieve the SAML validating URL of the CAS server.

return: string samlValidate URL.

getServerProxyValidateURL()   X-Ref
This method is used to retrieve the proxy validating URL of the CAS server.

return: string proxyValidate URL.

getServerProxyURL()   X-Ref
This method is used to retrieve the proxy URL of the CAS server.

return: string proxy URL.

getServerLogoutURL()   X-Ref
This method is used to retrieve the logout URL of the CAS server.

return: string logout URL.

setServerLogoutURL($url)   X-Ref
This method sets the logout URL of the CAS server.

param: string $url the logout URL
return: string logout url

setExtraCurlOption($key, $value)   X-Ref
This method is used to set additional user curl options.

param: string $key   name of the curl option
param: string $value value of the curl option
return: void

setRequestImplementation($className)   X-Ref
Override the default implementation used to make web requests in readUrl().
This class must implement the CAS_Request_RequestInterface.

param: string $className name of the RequestImplementation class
return: void

setNoClearTicketsFromUrl()   X-Ref
Configure the client to not send redirect headers and call exit() on
authentication success. The normal redirect is used to remove the service
ticket from the client's URL, but for running unit tests we need to
continue without exiting.

Needed for testing authentication

return: void

setCasAttributeParserCallback($function, array $additionalArgs = array()   X-Ref
Set a callback function to be run when parsing CAS attributes

The callback function will be passed a XMLNode as its first parameter,
followed by any $additionalArgs you pass.

param: string $function       callback function to call
param: array  $additionalArgs optional array of arguments
return: void

setPostAuthenticateCallback($function, array $additionalArgs = array()   X-Ref
Set a callback function to be run when a user authenticates.

The callback function will be passed a $logoutTicket as its first parameter,
followed by any $additionalArgs you pass. The $logoutTicket parameter is an
opaque string that can be used to map a session-id to the logout request
in order to support single-signout in applications that manage their own
sessions (rather than letting phpCAS start the session).

phpCAS::forceAuthentication() will always exit and forward client unless
they are already authenticated. To perform an action at the moment the user
logs in (such as registering an account, performing logging, etc), register
a callback function here.

param: callable $function       callback function to call
param: array  $additionalArgs optional array of arguments
return: void

setSingleSignoutCallback($function, array $additionalArgs = array()   X-Ref
Set a callback function to be run when a single-signout request is received.

The callback function will be passed a $logoutTicket as its first parameter,
followed by any $additionalArgs you pass. The $logoutTicket parameter is an
opaque string that can be used to map a session-id to the logout request in
order to support single-signout in applications that manage their own sessions
(rather than letting phpCAS start and destroy the session).

param: callable $function       callback function to call
param: array  $additionalArgs optional array of arguments
return: void

ensureIsProxy()   X-Ref
Ensure that this is actually a proxy object or fail with an exception

return: void

markAuthenticationCall($auth)   X-Ref
Mark the caller of authentication. This will help client integraters determine
problems with their code flow if they call a function such as getUser() before
authentication has occurred.

param: bool $auth True if authentication was successful, false otherwise.
return: null

wasAuthenticationCalled()   X-Ref
Answer true if authentication has been checked.

return: bool

_ensureAuthenticationCalled()   X-Ref
Ensure that authentication was checked. Terminate with exception if no
authentication was performed

return: void

wasAuthenticationCallSuccessful()   X-Ref
Answer the result of the authentication call.

Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false
and markAuthenticationCall() didn't happen.

return: bool

ensureAuthenticationCallSuccessful()   X-Ref
Ensure that authentication was checked. Terminate with exception if no
authentication was performed

return: void

getAuthenticationCallerFile()   X-Ref
Answer information about the authentication caller.

Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false
and markAuthenticationCall() didn't happen.

return: string the file that called authentication

getAuthenticationCallerLine()   X-Ref
Answer information about the authentication caller.

Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false
and markAuthenticationCall() didn't happen.

return: int the line that called authentication

getAuthenticationCallerMethod()   X-Ref
Answer information about the authentication caller.

Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false
and markAuthenticationCall() didn't happen.

return: string the method that called authentication

__construct($server_version,$proxy,$server_hostname,$server_port,$server_uri,$changeSessionID = true)   X-Ref
CAS_Client constructor.

param: string $server_version  the version of the CAS server
param: bool   $proxy           true if the CAS client is a CAS proxy
param: string $server_hostname the hostname of the CAS server
param: int    $server_port     the port the CAS server is running on
param: string $server_uri      the URI the CAS server is responding on
param: bool   $changeSessionID Allow phpCAS to change the session_id
return: self a newly created CAS_Client object

_setChangeSessionID($allowed)   X-Ref
Set a parameter whether to allow phpCAS to change session_id

param: bool $allowed allow phpCAS to change session_id
return: void

getChangeSessionID()   X-Ref
Get whether phpCAS is allowed to change session_id

return: bool

_setUser($user)   X-Ref
This method sets the CAS user's login name.

param: string $user the login name of the authenticated user.
return: void

getUser()   X-Ref
This method returns the CAS user's login name.

return: string the login name of the authenticated user

_getUser()   X-Ref
This method returns the CAS user's login name.

return: string the login name of the authenticated user

setAttributes($attributes)   X-Ref
Set an array of attributes

param: array $attributes a key value array of attributes
return: void

getAttributes()   X-Ref
Get an key values arry of attributes

return: array of attributes

hasAttributes()   X-Ref
Check whether attributes are available

return: bool attributes available

hasAttribute($key)   X-Ref
Check whether a specific attribute with a name is available

param: string $key name of attribute
return: bool is attribute available

_hasAttribute($key)   X-Ref
Check whether a specific attribute with a name is available

param: string $key name of attribute
return: bool is attribute available

getAttribute($key)   X-Ref
Get a specific attribute by name

param: string $key name of attribute
return: string attribute values

renewAuthentication()   X-Ref
This method is called to renew the authentication of the user
If the user is authenticated, renew the connection
If not, redirect to CAS

return: bool true when the user is authenticated; otherwise halt.

forceAuthentication()   X-Ref
This method is called to be sure that the user is authenticated. When not
authenticated, halt by redirecting to the CAS server; otherwise return true.

return: bool true when the user is authenticated; otherwise halt.

setCacheTimesForAuthRecheck($n)   X-Ref
Set the number of times authentication will be cached before rechecked.

param: int $n number of times to wait for a recheck
return: void

checkAuthentication()   X-Ref
This method is called to check whether the user is authenticated or not.

return: bool true when the user is authenticated, false when a previous

isAuthenticated($renew=false)   X-Ref
This method is called to check if the user is authenticated (previously or by
tickets given in the URL).

param: bool $renew true to force the authentication with the CAS server
return: bool true when the user is authenticated. Also may redirect to the

isSessionAuthenticated()   X-Ref
This method tells if the current session is authenticated.

return: bool true if authenticated based soley on $_SESSION variable

_wasPreviouslyAuthenticated()   X-Ref
This method tells if the user has already been (previously) authenticated
by looking into the session variables.

return: bool true when the user has already been authenticated; false otherwise.

redirectToCas($gateway=false,$renew=false)   X-Ref
This method is used to redirect the client to the CAS server.
It is used by CAS_Client::forceAuthentication() and
CAS_Client::checkAuthentication().

param: bool $gateway true to check authentication, false to force it
param: bool $renew   true to force the authentication with the CAS server
return: void

logout($params)   X-Ref
This method is used to logout from CAS.

param: array $params an array that contains the optional url and service
return: void

_isLogoutRequest()   X-Ref
Check of the current request is a logout request

return: bool is logout request.

handleLogoutRequests($check_client=true, $allowed_clients=array()   X-Ref
This method handles logout requests.

param: bool $check_client    true to check the client bofore handling
param: array $allowed_clients an array of host names allowed to send
return: void

getTicket()   X-Ref
This method returns the Service Ticket provided in the URL of the request.

return: string service ticket.

setTicket($st)   X-Ref
This method stores the Service Ticket.

param: string $st The Service Ticket.
return: void

hasTicket()   X-Ref
This method tells if a Service Ticket was stored.

return: bool if a Service Ticket has been stored.

setCasServerCACert($cert, $validate_cn)   X-Ref
Set the CA certificate of the CAS server.

param: string $cert        the PEM certificate file name of the CA that emited
param: bool   $validate_cn valiate CN of the CAS server certificate
return: void

setNoCasServerValidation()   X-Ref
Set no SSL validation for the CAS server.

return: void

validateCAS10(&$validate_url,&$text_response,&$tree_response,$renew=false)   X-Ref
This method is used to validate a CAS 1,0 ticket; halt on failure, and
sets $validate_url, $text_reponse and $tree_response on success.

param: string &$validate_url  reference to the the URL of the request to
param: string &$text_response reference to the response of the CAS
param: string &$tree_response reference to the response of the CAS
param: bool   $renew          true to force the authentication with the CAS server
return: bool true when successfull and issue a CAS_AuthenticationException

validateSA(&$validate_url,&$text_response,&$tree_response,$renew=false)   X-Ref
This method is used to validate a SAML TICKET; halt on failure, and sets
$validate_url, $text_reponse and $tree_response on success. These
parameters are used later by CAS_Client::_validatePGT() for CAS proxies.

param: string &$validate_url  reference to the the URL of the request to
param: string &$text_response reference to the response of the CAS
param: string &$tree_response reference to the response of the CAS
param: bool   $renew          true to force the authentication with the CAS server
return: bool true when successfull and issue a CAS_AuthenticationException

_setSessionAttributes($text_response)   X-Ref
This method will parse the DOM and pull out the attributes from the SAML
payload and put them into an array, then put the array into the session.

param: string $text_response the SAML payload.
return: bool true when successfull and false if no attributes a found

isProxy()   X-Ref
Tells if a CAS client is a CAS proxy or not

return: bool true when the CAS client is a CAS proxy, false otherwise

_getPGT()   X-Ref
This method returns the Proxy Granting Ticket given by the CAS server.

return: string the Proxy Granting Ticket.

_setPGT($pgt)   X-Ref
This method stores the Proxy Granting Ticket.

param: string $pgt The Proxy Granting Ticket.
return: void

_hasPGT()   X-Ref
This method tells if a Proxy Granting Ticket was stored.

return: bool true if a Proxy Granting Ticket has been stored.

_setCallbackMode($callback_mode)   X-Ref
This method sets/unsets callback mode.

param: bool $callback_mode true to set callback mode, false otherwise.
return: void

_isCallbackMode()   X-Ref
This method returns true when the CAS client is running in callback mode,
false otherwise.

return: bool A boolean.

_setCallbackModeUsingPost($callback_mode_using_post)   X-Ref
This method sets/unsets usage of POST parameters in callback mode (default/false is GET parameters)

param: bool $callback_mode_using_post true to use POST, false to use GET (default).
return: void

_isCallbackModeUsingPost()   X-Ref
This method returns true when the callback mode is using POST, false otherwise.

return: bool A boolean.

_getCallbackURL()   X-Ref
This method returns the URL that should be used for the PGT callback (in
fact the URL of the current request without any CGI parameter, except if
phpCAS::setFixedCallbackURL() was used).

return: string The callback URL

setCallbackURL($url)   X-Ref
This method sets the callback url.

param: string $url url to set callback
return: string the callback url

_callback()   X-Ref
This method is called by CAS_Client::CAS_Client() when running in callback
mode. It stores the PGT and its PGT Iou, prints its output and halts.

return: void

_initPGTStorage()   X-Ref
This method is used to initialize the storage of PGT's.
Halts on error.

return: void

_storePGT($pgt,$pgt_iou)   X-Ref
This method stores a PGT. Halts on error.

param: string $pgt     the PGT to store
param: string $pgt_iou its corresponding Iou
return: void

_loadPGT($pgt_iou)   X-Ref
This method reads a PGT from its Iou and deletes the corresponding
storage entry.

param: string $pgt_iou the PGT Iou
return: string mul The PGT corresponding to the Iou, false when not found.

setPGTStorage($storage)   X-Ref
This method can be used to set a custom PGT storage object.

param: CAS_PGTStorage_AbstractStorage $storage a PGT storage object that
return: void

setPGTStorageDb($dsn_or_pdo, $username='', $password='', $table='', $driver_options=null)   X-Ref
This method is used to tell phpCAS to store the response of the
CAS server to PGT requests in a database.

param: string|PDO $dsn_or_pdo     a dsn string to use for creating a PDO
param: string $username       the username to use when connecting to the
param: string $password       the password to use when connecting to the
param: string $table          the table to use for storing and retrieving
param: string $driver_options any driver options to use when connecting
return: void

setPGTStorageFile($path='')   X-Ref
This method is used to tell phpCAS to store the response of the
CAS server to PGT requests onto the filesystem.

param: string $path the path where the PGT's should be stored
return: void

_validatePGT(&$validate_url,$text_response,$tree_response)   X-Ref
This method is used to validate a PGT; halt on failure.

param: string &$validate_url the URL of the request to the CAS server.
param: string $text_response the response of the CAS server, as is
param: DOMElement $tree_response the response of the CAS server, as a DOM XML
return: bool true when successfull and issue a CAS_AuthenticationException

retrievePT($target_service,&$err_code,&$err_msg)   X-Ref
This method is used to retrieve PT's from the CAS server thanks to a PGT.

param: string $target_service the service to ask for with the PT.
param: int &$err_code      an error code (PHPCAS_SERVICE_OK on success).
param: string &$err_msg       an error message (empty on success).
return: string|false a Proxy Ticket, or false on error.

_readURL($url, &$headers, &$body, &$err_msg)   X-Ref
This method is used to acces a remote URL.

param: string $url      the URL to access.
param: string &$headers an array containing the HTTP header lines of the
param: string &$body    the body of the response, as a string (empty on
param: string &$err_msg an error message, filled on failure.
return: bool true on success, false otherwise (in this later case, $err_msg

_buildSAMLPayload()   X-Ref
This method is used to build the SAML POST body sent to /samlValidate URL.

return: string the SOAP-encased SAMLP artifact (the ticket).

getProxiedService($type)   X-Ref
Answer a proxy-authenticated service handler.

param: string $type The service type. One of:
return: CAS_ProxiedService

initializeProxiedService(CAS_ProxiedService $proxiedService)   X-Ref
Initialize a proxied-service handler with the proxy-ticket it should use.

param: CAS_ProxiedService $proxiedService service handler
return: void

serviceWeb($url,&$err_code,&$output)   X-Ref
This method is used to access an HTTP[S] service.

param: string $url       the service to access.
param: int    &$err_code an error code Possible values are
param: string &$output   the output of the service (also used to give an error
return: bool true on success, false otherwise (in this later case, $err_code

serviceMail($url,$serviceUrl,$flags,&$err_code,&$err_msg,&$pt)   X-Ref
This method is used to access an IMAP/POP3/NNTP service.

param: string $url        a string giving the URL of the service, including
param: string $serviceUrl a string giving for CAS retrieve Proxy ticket
param: string $flags      options given to imap_open().
param: int    &$err_code  an error code Possible values are
param: string &$err_msg   an error message on failure
param: string &$pt        the Proxy Ticket (PT) retrieved from the CAS
return: object|false an IMAP stream on success, false otherwise (in this later

getProxies()   X-Ref
Answer an array of proxies that are sitting in front of this application.

This method will only return a non-empty array if we have received and
validated a Proxy Ticket.

return: array

_setProxies($proxies)   X-Ref
Set the Proxy array, probably from persistant storage.

param: array $proxies An array of proxies
return: void

getAllowedProxyChains()   X-Ref
Answer the CAS_ProxyChain_AllowedList object for this client.

return: CAS_ProxyChain_AllowedList

validateCAS20(&$validate_url,&$text_response,&$tree_response, $renew=false)   X-Ref
This method is used to validate a cas 2.0 ST or PT; halt on failure
Used for all CAS 2.0 validations

param: string &$validate_url  the url of the reponse
param: string &$text_response the text of the repsones
param: DOMElement &$tree_response the domxml tree of the respones
param: bool   $renew          true to force the authentication with the CAS server
return: bool true when successfull and issue a CAS_AuthenticationException

_readExtraAttributesCas20($success_elements)   X-Ref
This method will parse the DOM and pull out the attributes from the XML
payload and put them into an array, then put the array into the session.

param: DOMNodeList $success_elements payload of the response
return: bool true when successfull, halt otherwise by calling

_addAttributeToArray(array &$attributeArray, $name, $value)   X-Ref
Add an attribute value to an array of attributes.

param: array  &$attributeArray reference to array
param: string $name            name of attribute
param: string $value           value of attribute
return: void

setURL($url)   X-Ref
This method sets the URL of the current request

param: string $url url to set for service
return: void

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

return: string The URL

setBaseURL($url)   X-Ref
This method sets the base URL of the CAS server.

param: string $url the base URL
return: string base url

_getClientUrl()   X-Ref
Try to figure out the phpCAS client URL with possible Proxys / Ports etc.

return: string Server URL with domain:port

_isHttps()   X-Ref
This method checks to see if the request is secured via HTTPS

return: bool true if https, false otherwise

_removeParameterFromQueryString($parameterName, $queryString)   X-Ref
Removes a parameter from a query string

param: string $parameterName name of parameter
param: string $queryString   query string
return: string new query string

_buildQueryUrl($url, $query)   X-Ref
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

param: string $url   base url to add the query params to
param: string $query params in query form with & separated
return: string url with query params

_renameSession($ticket)   X-Ref
Renaming the session

param: string $ticket name of the ticket
return: void

_sessionIdForTicket($ticket)   X-Ref
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.


param: string $ticket name of the ticket
return: string

setSessionIdSalt($salt)   X-Ref
Set a salt/seed for the session-id hash to make it harder to guess.

param: string $salt
return: void

_authError($failure,$cas_url,$no_response=false,$bad_response=false,$cas_response='',$err_code=-1,$err_msg='')   X-Ref
This method is used to print the HTML output when the user was not
authenticated.

param: string $failure      the failure that occured
param: string $cas_url      the URL the CAS server was asked for
param: bool   $no_response  the response from the CAS server (other
param: bool   $bad_response bad response from the CAS server ($err_code
param: string $cas_response the response of the CAS server
param: int    $err_code     the error code given by the CAS server
param: string $err_msg      the error message given by the CAS server
return: void

_getNodeType($nodeURL)   X-Ref
Determine the node type from the URL.

param: String $nodeURL The node URL.
return: int hostname

addRebroadcastNode($rebroadcastNodeUrl)   X-Ref
Store the rebroadcast node for pgtIou/pgtId and logout requests.

param: string $rebroadcastNodeUrl The rebroadcast node URL.
return: void

addRebroadcastHeader($header)   X-Ref
This method is used to add header parameters when rebroadcasting
pgtIou/pgtId or logoutRequest.

param: string $header Header to send when rebroadcasting.
return: void

_rebroadcast($type)   X-Ref
This method rebroadcasts logout/pgtIou requests. Can be LOGOUT,PGTIOU

param: int $type type of rebroadcasting.
return: void