phpCAS  version 1.4.0
Modules | Functions | Variables
Configuration

Modules

 Internal behaviour of phpCAS
 
 HTML output
 
 Internationalization
 

Functions

 CAS_Client::getServerVersion ()
 
 CAS_Client::_getServerHostname ()
 
 CAS_Client::_getServerPort ()
 
 CAS_Client::_getServerURI ()
 
 CAS_Client::_getServerBaseURL ()
 
 CAS_Client::getServerLoginURL ($gateway=false, $renew=false)
 
 CAS_Client::setServerLoginURL ($url)
 
 CAS_Client::setServerServiceValidateURL ($url)
 
 CAS_Client::setServerProxyValidateURL ($url)
 
 CAS_Client::setServerSamlValidateURL ($url)
 
 CAS_Client::getServerServiceValidateURL ()
 
 CAS_Client::getServerSamlValidateURL ()
 
 CAS_Client::getServerProxyValidateURL ()
 
 CAS_Client::getServerProxyURL ()
 
 CAS_Client::getServerLogoutURL ()
 
 CAS_Client::setServerLogoutURL ($url)
 
 CAS_Client::setExtraCurlOption ($key, $value)
 
 CAS_Client::__construct ( $server_version, $proxy, $server_hostname, $server_port, $server_uri, $changeSessionID=true, \SessionHandlerInterface $sessionHandler=null)
 
 CAS_Client::_setChangeSessionID ($allowed)
 
 CAS_Client::getChangeSessionID ()
 
 CAS_Client::setSessionHandler (\SessionHandlerInterface $sessionHandler)
 
 CAS_Client::getSessionValue ($key, $default=null)
 
 CAS_Client::hasSessionValue ($key)
 
 CAS_Client::setSessionValue ($key, $value)
 
 CAS_Client::removeSessionValue ($key)
 
 CAS_Client::clearSessionValues ()
 
 CAS_Client::validateSession ($key)
 
 CAS_Client::_renameSession ($ticket)
 

Variables

 CAS_Client::$_server
 
 CAS_Client::$_curl_options = array()
 
const CAS_Client::PHPCAS_SESSION_PREFIX = 'phpCAS'
 
 CAS_Client::$_change_session_id = true
 
 CAS_Client::$_sessionHandler
 

Detailed Description

Function Documentation

◆ __construct()

CAS_Client::__construct (   $server_version,
  $proxy,
  $server_hostname,
  $server_port,
  $server_uri,
  $changeSessionID = true,
\SessionHandlerInterface  $sessionHandler = null 
)

CAS_Client constructor.

Parameters
string$server_versionthe version of the CAS server
bool$proxytrue if the CAS client is a CAS proxy
string$server_hostnamethe hostname of the CAS server
int$server_portthe port the CAS server is running on
string$server_urithe URI the CAS server is responding on
bool$changeSessionIDAllow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
\SessionHandlerInterface$sessionHandlerthe session handler
Returns
self a newly created CAS_Client object

Definition at line 905 of file Client.php.

References CAS_Client\_isCallbackMode(), CAS_Client\_isHttps(), CAS_Client\_isLogoutRequest(), CAS_Client\_setCallbackMode(), CAS_Client\_setCallbackModeUsingPost(), CAS_Client\_setChangeSessionID(), phpCAS\error(), CAS_Client\getSessionValue(), phpCAS\getSupportedProtocols(), CAS_Client\hasSessionValue(), CAS_Client\isProxy(), CAS_Client\isSessionAuthenticated(), CAS_Client\setSessionHandler(), CAS_Client\setSessionValue(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

◆ _getServerBaseURL()

CAS_Client::_getServerBaseURL ( )
private

◆ _getServerHostname()

CAS_Client::_getServerHostname ( )
private

This method is used to retrieve the hostname of the CAS server.

Returns
string the hostname of the CAS server.

Definition at line 285 of file Client.php.

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

◆ _getServerPort()

CAS_Client::_getServerPort ( )
private

This method is used to retrieve the port of the CAS server.

Returns
int the port of the CAS server.

Definition at line 295 of file Client.php.

Referenced by CAS_Client\_getServerBaseURL().

◆ _getServerURI()

CAS_Client::_getServerURI ( )
private

This method is used to retrieve the URI of the CAS server.

Returns
string a URI.

Definition at line 305 of file Client.php.

Referenced by CAS_Client\_getServerBaseURL().

◆ _renameSession()

CAS_Client::_renameSession (   $ticket)
protected

Renaming the session

Parameters
string$ticketname of the ticket
Returns
void

Definition at line 1221 of file Client.php.

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

Referenced by CAS_Client\validateSA().

◆ _setChangeSessionID()

CAS_Client::_setChangeSessionID (   $allowed)
private

Set a parameter whether to allow phpCAS to change session_id

Parameters
bool$allowedallow phpCAS to change session_id
Returns
void

Definition at line 1091 of file Client.php.

Referenced by CAS_Client\__construct().

◆ clearSessionValues()

CAS_Client::clearSessionValues ( )
protected

Remove all phpCAS session values.

Definition at line 1193 of file Client.php.

Referenced by CAS_Client\_wasPreviouslyAuthenticated().

◆ getChangeSessionID()

CAS_Client::getChangeSessionID ( )

Get whether phpCAS is allowed to change session_id

Returns
bool

Definition at line 1101 of file Client.php.

References CAS_Client\$_change_session_id.

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

◆ getServerLoginURL()

CAS_Client::getServerLoginURL (   $gateway = false,
  $renew = false 
)

This method is used to retrieve the login URL of the CAS server.

Parameters
bool$gatewaytrue to check authentication, false to force it
bool$renewtrue to force the authentication with the CAS server
Returns
string a URL.
Note
It is recommended that CAS implementations ignore the "gateway" parameter if "renew" is set

Definition at line 339 of file Client.php.

References CAS_Client\_buildQueryUrl(), CAS_Client\_getServerBaseURL(), CAS_Client\getURL(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\redirectToCas().

◆ getServerLogoutURL()

CAS_Client::getServerLogoutURL ( )

This method is used to retrieve the logout URL of the CAS server.

Returns
string logout URL.

Definition at line 543 of file Client.php.

References CAS_Client\_getServerBaseURL().

Referenced by CAS_Client\logout().

◆ getServerProxyURL()

CAS_Client::getServerProxyURL ( )

This method is used to retrieve the proxy URL of the CAS server.

Returns
string proxy URL.

Definition at line 521 of file Client.php.

References CAS_Client\_getServerBaseURL(), CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, and CAS_Client\getServerVersion().

Referenced by CAS_Client\retrievePT().

◆ getServerProxyValidateURL()

CAS_Client::getServerProxyValidateURL ( )

This method is used to retrieve the proxy validating URL of the CAS server.

Returns
string proxyValidate URL.

Definition at line 490 of file Client.php.

References CAS_Client\_buildQueryUrl(), CAS_Client\_getServerBaseURL(), CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, CAS_Client\getServerVersion(), CAS_Client\getURL(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\validateCAS20().

◆ getServerSamlValidateURL()

CAS_Client::getServerSamlValidateURL ( )

This method is used to retrieve the SAML validating URL of the CAS server.

Returns
string samlValidate URL.

Definition at line 465 of file Client.php.

References CAS_Client\_buildQueryUrl(), CAS_Client\_getServerBaseURL(), CAS_Client\getServerVersion(), CAS_Client\getURL(), SAML_VERSION_1_1, phpCAS\traceBegin(), and phpCAS\traceEnd().

◆ getServerServiceValidateURL()

CAS_Client::getServerServiceValidateURL ( )

This method is used to retrieve the service validating URL of the CAS server.

Returns
string serviceValidate URL.

Definition at line 433 of file Client.php.

References CAS_Client\_buildQueryUrl(), CAS_Client\_getServerBaseURL(), CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, CAS_Client\getServerVersion(), CAS_Client\getURL(), phpCAS\traceBegin(), and phpCAS\traceEnd().

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

◆ getServerVersion()

CAS_Client::getServerVersion ( )

◆ getSessionValue()

CAS_Client::getSessionValue (   $key,
  $default = null 
)
protected

Get a session value using the given key.

Parameters
string$key
mixed$defaultdefault value if the key is not set
Returns
mixed

Definition at line 1130 of file Client.php.

References CAS_Client\validateSession().

Referenced by CAS_Client\__construct(), CAS_Client\_wasPreviouslyAuthenticated(), CAS_Client\checkAuthentication(), and CAS_Client\isSessionAuthenticated().

◆ hasSessionValue()

CAS_Client::hasSessionValue (   $key)
protected

Determine whether a session value is set or not.

To check if a session value is empty or not please use !!(getSessionValue($key)).

Parameters
string$key
Returns
bool

Definition at line 1151 of file Client.php.

References CAS_Client\validateSession().

Referenced by CAS_Client\__construct(), and CAS_Client\_wasPreviouslyAuthenticated().

◆ removeSessionValue()

CAS_Client::removeSessionValue (   $key)
protected

Remove a session value with the given key.

Parameters
string$key

Definition at line 1178 of file Client.php.

References CAS_Client\validateSession().

Referenced by CAS_Client\checkAuthentication(), CAS_Client\forceAuthentication(), and CAS_Client\renewAuthentication().

◆ setExtraCurlOption()

CAS_Client::setExtraCurlOption (   $key,
  $value 
)

This method is used to set additional user curl options.

Parameters
string$keyname of the curl option
string$valuevalue of the curl option
Returns
void

Definition at line 581 of file Client.php.

◆ setServerLoginURL()

CAS_Client::setServerLoginURL (   $url)

This method sets the login URL of the CAS server.

Parameters
string$urlthe login URL
Returns
string login url

Definition at line 367 of file Client.php.

◆ setServerLogoutURL()

CAS_Client::setServerLogoutURL (   $url)

This method sets the logout URL of the CAS server.

Parameters
string$urlthe logout URL
Returns
string logout url

Definition at line 559 of file Client.php.

◆ setServerProxyValidateURL()

CAS_Client::setServerProxyValidateURL (   $url)

This method sets the proxyValidate URL of the CAS server.

Parameters
string$urlthe proxyValidate URL
Returns
string proxyValidate URL

Definition at line 401 of file Client.php.

◆ setServerSamlValidateURL()

CAS_Client::setServerSamlValidateURL (   $url)

This method sets the samlValidate URL of the CAS server.

Parameters
string$urlthe samlValidate URL
Returns
string samlValidate URL

Definition at line 418 of file Client.php.

◆ setServerServiceValidateURL()

CAS_Client::setServerServiceValidateURL (   $url)

This method sets the serviceValidate URL of the CAS server.

Parameters
string$urlthe serviceValidate URL
Returns
string serviceValidate URL

Definition at line 384 of file Client.php.

◆ setSessionHandler()

CAS_Client::setSessionHandler ( \SessionHandlerInterface  $sessionHandler)

Set the session handler.

Parameters
\SessionHandlerInterface$sessionHandler
Returns
bool

Definition at line 1113 of file Client.php.

Referenced by CAS_Client\__construct().

◆ setSessionValue()

CAS_Client::setSessionValue (   $key,
  $value 
)
protected

Set a session value using the given key and value.

Parameters
string$key
mixed$value
Returns
string

Definition at line 1166 of file Client.php.

References CAS_Client\validateSession().

Referenced by CAS_Client\__construct(), CAS_Client\checkAuthentication(), and CAS_Client\isAuthenticated().

◆ validateSession()

CAS_Client::validateSession (   $key)
protected

Ensure $key is a string for session utils input

Parameters
string$key
Returns
bool

Definition at line 1205 of file Client.php.

Referenced by CAS_Client\getSessionValue(), CAS_Client\hasSessionValue(), CAS_Client\removeSessionValue(), and CAS_Client\setSessionValue().

Variable Documentation

◆ $_change_session_id

CAS_Client::$_change_session_id = true
private

Definition at line 1077 of file Client.php.

Referenced by CAS_Client\getChangeSessionID().

◆ $_curl_options

CAS_Client::$_curl_options = array()
private

An array to store extra curl options.

Definition at line 571 of file Client.php.

◆ $_server

CAS_Client::$_server
private

a record to store information about the CAS server.

  • $_server['version']: the version of the CAS server
  • $_server['hostname']: the hostname of the CAS server
  • $_server['port']: the port the CAS server is running on
  • $_server['uri']: the base URI the CAS server is responding on
  • $_server['base_url']: the base URL of the CAS server
  • $_server['login_url']: the login URL of the CAS server
  • $_server['service_validate_url']: the service validating URL of the CAS server
  • $_server['proxy_url']: the proxy URL of the CAS server
  • $_server['proxy_validate_url']: the proxy validating URL of the CAS server
  • $_server['logout_url']: the logout URL of the CAS server

$_server['version'], $_server['hostname'], $_server['port'] and $_server['uri'] are written by CAS_Client::CAS_Client(), read by CAS_Client::getServerVersion(), CAS_Client::_getServerHostname(), CAS_Client::_getServerPort() and CAS_Client::_getServerURI().

The other fields are written and read by CAS_Client::_getServerBaseURL(), CAS_Client::getServerLoginURL(), CAS_Client::getServerServiceValidateURL(), CAS_Client::getServerProxyValidateURL() and CAS_Client::getServerLogoutURL().

Definition at line 264 of file Client.php.

◆ $_sessionHandler

CAS_Client::$_sessionHandler
private

Definition at line 1082 of file Client.php.

◆ PHPCAS_SESSION_PREFIX

const CAS_Client::PHPCAS_SESSION_PREFIX = 'phpCAS'

The session prefix for phpCAS values

Definition at line 1071 of file Client.php.