ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Authentication
+ Collaboration diagram for Authentication:

Functions

static phpCAS::setCacheTimesForAuthRecheck ($n)
 Set the times authentication will be cached before really accessing the CAS server in gateway mode: More...
 
static phpCAS::setCasAttributeParserCallback ($function, array $additionalArgs=array())
 Set a callback function to be run when receiving CAS attributes. More...
 
static phpCAS::setPostAuthenticateCallback ($function, array $additionalArgs=array())
 Set a callback function to be run when a user authenticates. More...
 
static phpCAS::setSingleSignoutCallback ($function, array $additionalArgs=array())
 Set a callback function to be run when a single-signout request is received. More...
 
static phpCAS::checkAuthentication ()
 This method is called to check if the user is already authenticated locally or has a global cas session. More...
 
static phpCAS::forceAuthentication ()
 This method is called to force authentication if the user was not already authenticated. More...
 
static phpCAS::renewAuthentication ()
 This method is called to renew the authentication. More...
 
static phpCAS::isAuthenticated ()
 This method is called to check if the user is authenticated (previously or by tickets given in the URL). More...
 
static phpCAS::isSessionAuthenticated ()
 Checks whether authenticated based on $_SESSION. More...
 
static phpCAS::getUser ()
 This method returns the CAS user's login name. More...
 
static phpCAS::getAttributes ()
 Answer attributes about the authenticated user. More...
 
static phpCAS::hasAttributes ()
 Answer true if there are attributes for the authenticated user. More...
 
static phpCAS::hasAttribute ($key)
 Answer true if an attribute exists for the authenticated user. More...
 
static phpCAS::getAttribute ($key)
 Answer an attribute for the authenticated user. More...
 
static phpCAS::handleLogoutRequests ($check_client=true, $allowed_clients=false)
 Handle logout requests. More...
 
static phpCAS::getServerLoginURL ()
 This method returns the URL to be used to login. More...
 
static phpCAS::setServerLoginURL ($url='')
 Set the login URL of the CAS server. More...
 
static phpCAS::setServerServiceValidateURL ($url='')
 Set the serviceValidate URL of the CAS server. More...
 
static phpCAS::setServerProxyValidateURL ($url='')
 Set the proxyValidate URL of the CAS server. More...
 
static phpCAS::setServerSamlValidateURL ($url='')
 Set the samlValidate URL of the CAS server. More...
 
static phpCAS::getServerLogoutURL ()
 This method returns the URL to be used to login. More...
 
static phpCAS::setServerLogoutURL ($url='')
 Set the logout URL of the CAS server. More...
 
static phpCAS::logout ($params="")
 This method is used to logout from CAS. More...
 
static phpCAS::logoutWithRedirectService ($service)
 This method is used to logout from CAS. More...
 
static phpCAS::logoutWithUrl ($url)
 This method is used to logout from CAS. More...
 
static phpCAS::logoutWithRedirectServiceAndUrl ($service, $url)
 This method is used to logout from CAS. More...
 
static phpCAS::setFixedCallbackURL ($url='')
 Set the fixed URL that will be used by the CAS server to transmit the PGT. More...
 
static phpCAS::setFixedServiceURL ($url)
 Set the fixed URL that will be set as the CAS service parameter. More...
 
static phpCAS::getServiceURL ()
 Get the URL that is set as the CAS service parameter. More...
 
static phpCAS::retrievePT ($target_service, &$err_code, &$err_msg)
 Retrieve a Proxy Ticket from the CAS server. More...
 
static phpCAS::setCasServerCACert ($cert, $validate_cn=true)
 Set the certificate of the CAS server CA and if the CN should be properly verified. More...
 
static phpCAS::setNoCasServerValidation ()
 Set no SSL validation for the CAS server. More...
 
static phpCAS::setNoClearTicketsFromUrl ()
 Disable the removal of a CAS-Ticket from the URL when authenticating DISABLING POSES A SECURITY RISK: We normally remove the ticket by an additional redirect as a security precaution to prevent a ticket in the HTTP_REFERRER or be carried over in the URL parameter. More...
 

Detailed Description

Function Documentation

◆ checkAuthentication()

static phpCAS::checkAuthentication ( )
static

This method is called to check if the user is already authenticated locally or has a global cas session.

A already existing cas session is determined by a cas gateway call.(cas login call without any interactive prompt)

Returns
true when the user is authenticated, false when a previous gateway login failed or the function will not return if the user is redirected to the cas server for a gateway login attempt

Definition at line 1097 of file CAS.php.

References $auth, phpCAS\_validateClientExists(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilSoapAuthenticationCAS\authenticate().

1098  {
1101 
1102  $auth = self::$_PHPCAS_CLIENT->checkAuthentication();
1103 
1104  // store where the authentication has been checked and the result
1105  self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
1106 
1108  return $auth;
1109  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
$auth
Definition: fileserver.php:48
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceAuthentication()

static phpCAS::forceAuthentication ( )
static

This method is called to force authentication if the user was not already authenticated.

If the user is not authenticated, halt by redirecting to the CAS server.

Returns
bool Authentication

Definition at line 1118 of file CAS.php.

References $auth, phpCAS\_validateClientExists(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilAuthProviderCAS\doAuthentication(), and ilCASAuth\forceCASAuth().

1119  {
1122  $auth = self::$_PHPCAS_CLIENT->forceAuthentication();
1123 
1124  // store where the authentication has been checked and the result
1125  self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
1126 
1127  /* if (!$auth) {
1128  phpCAS :: trace('user is not authenticated, redirecting to the CAS server');
1129  self::$_PHPCAS_CLIENT->forceAuthentication();
1130  } else {
1131  phpCAS :: trace('no need to authenticate (user `' . phpCAS :: getUser() . '\' is already authenticated)');
1132  }*/
1133 
1135  return $auth;
1136  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
$auth
Definition: fileserver.php:48
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttribute()

static phpCAS::getAttribute (   $key)
static

Answer an attribute for the authenticated user.

Parameters
string$keyattribute name
Returns
mixed string for a single value or an array if multiple values exist.
Warning
should only be called after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().

Definition at line 1277 of file CAS.php.

References $key, phpCAS\_validateClientExists(), and phpCAS\error().

1278  {
1280 
1281  try {
1282  return self::$_PHPCAS_CLIENT->getAttribute($key);
1283  } catch (Exception $e) {
1284  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1285  }
1286  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ getAttributes()

static phpCAS::getAttributes ( )
static

Answer attributes about the authenticated user.

Warning
should only be called after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Returns
array

Definition at line 1218 of file CAS.php.

References phpCAS\_validateClientExists(), and phpCAS\error().

1219  {
1221 
1222  try {
1223  return self::$_PHPCAS_CLIENT->getAttributes();
1224  } catch (Exception $e) {
1225  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1226  }
1227  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ getServerLoginURL()

static phpCAS::getServerLoginURL ( )
static

This method returns the URL to be used to login.

or phpCAS::isAuthenticated().

Returns
the login name of the authenticated user

Definition at line 1309 of file CAS.php.

References phpCAS\_validateClientExists().

1310  {
1312 
1313  return self::$_PHPCAS_CLIENT->getServerLoginURL();
1314  }
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ getServerLogoutURL()

static phpCAS::getServerLogoutURL ( )
static

This method returns the URL to be used to login.

or phpCAS::isAuthenticated().

Returns
the login name of the authenticated user

Definition at line 1417 of file CAS.php.

References phpCAS\_validateClientExists().

1418  {
1420 
1421  return self::$_PHPCAS_CLIENT->getServerLogoutURL();
1422  }
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ getServiceURL()

static phpCAS::getServiceURL ( )
static

Get the URL that is set as the CAS service parameter.

Returns
string Service Url

Definition at line 1609 of file CAS.php.

References phpCAS\_validateProxyExists().

1610  {
1612  return (self::$_PHPCAS_CLIENT->getURL());
1613  }
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
+ Here is the call graph for this function:

◆ getUser()

static phpCAS::getUser ( )
static

This method returns the CAS user's login name.

Returns
string the login name of the authenticated user
Warning
should only be called after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().

Definition at line 1199 of file CAS.php.

References phpCAS\_validateClientExists(), and phpCAS\error().

Referenced by ilAuthProviderCAS\doAuthentication(), ilCASAuth\getCASUser(), and ilCASAuth\login().

1200  {
1202 
1203  try {
1204  return self::$_PHPCAS_CLIENT->getUser();
1205  } catch (Exception $e) {
1206  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1207  }
1208  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleLogoutRequests()

static phpCAS::handleLogoutRequests (   $check_client = true,
  $allowed_clients = false 
)
static

Handle logout requests.

Parameters
bool$check_clientadditional safety check
array$allowed_clientsarray of allowed clients
Returns
void

Definition at line 1296 of file CAS.php.

References phpCAS\_validateClientExists().

1297  {
1299 
1300  return (self::$_PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients));
1301  }
static handleLogoutRequests($check_client=true, $allowed_clients=false)
Handle logout requests.
Definition: CAS.php:1296
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ hasAttribute()

static phpCAS::hasAttribute (   $key)
static

Answer true if an attribute exists for the authenticated user.

Parameters
string$keyattribute name
Returns
bool
Warning
should only be called after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().

Definition at line 1257 of file CAS.php.

References $key, phpCAS\_validateClientExists(), and phpCAS\error().

1258  {
1260 
1261  try {
1262  return self::$_PHPCAS_CLIENT->hasAttribute($key);
1263  } catch (Exception $e) {
1264  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1265  }
1266  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ hasAttributes()

static phpCAS::hasAttributes ( )
static

Answer true if there are attributes for the authenticated user.

Warning
should only be called after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Returns
bool

Definition at line 1237 of file CAS.php.

References phpCAS\_validateClientExists(), and phpCAS\error().

1238  {
1240 
1241  try {
1242  return self::$_PHPCAS_CLIENT->hasAttributes();
1243  } catch (Exception $e) {
1244  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1245  }
1246  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ isAuthenticated()

static phpCAS::isAuthenticated ( )
static

This method is called to check if the user is authenticated (previously or by tickets given in the URL).

Returns
true when the user is authenticated.

Definition at line 1163 of file CAS.php.

References $auth, phpCAS\_validateClientExists(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1164  {
1167 
1168  // call the isAuthenticated method of the $_PHPCAS_CLIENT object
1169  $auth = self::$_PHPCAS_CLIENT->isAuthenticated();
1170 
1171  // store where the authentication has been checked and the result
1172  self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
1173 
1175  return $auth;
1176  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
$auth
Definition: fileserver.php:48
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ isSessionAuthenticated()

static phpCAS::isSessionAuthenticated ( )
static

Checks whether authenticated based on $_SESSION.

Useful to avoid server calls.

Returns
bool true if authenticated, false otherwise.
Since
0.4.22 by Brendan Arnold

Definition at line 1185 of file CAS.php.

References phpCAS\_validateClientExists().

1186  {
1188 
1189  return (self::$_PHPCAS_CLIENT->isSessionAuthenticated());
1190  }
static isSessionAuthenticated()
Checks whether authenticated based on $_SESSION.
Definition: CAS.php:1185
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ logout()

static phpCAS::logout (   $params = "")
static

This method is used to logout from CAS.

Parameters
string$paramsan array that contains the optional url and service parameters that will be passed to the CAS server
Returns
void

Definition at line 1454 of file CAS.php.

References $key, PHPMailer\PHPMailer\$params, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1455  {
1458 
1459  $parsedParams = array();
1460  if ($params != "") {
1461  if (is_string($params)) {
1462  phpCAS :: error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead');
1463  }
1464  if (!is_array($params)) {
1465  phpCAS :: error('type mismatched for parameter $params (should be `array\')');
1466  }
1467  foreach ($params as $key => $value) {
1468  if ($key != "service" && $key != "url") {
1469  phpCAS :: error('only `url\' and `service\' parameters are allowed for method `phpCAS::logout($params)\'');
1470  }
1471  $parsedParams[$key] = $value;
1472  }
1473  }
1474  self::$_PHPCAS_CLIENT->logout($parsedParams);
1475  // never reached
1477  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ logoutWithRedirectService()

static phpCAS::logoutWithRedirectService (   $service)
static

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
string$servicea URL that will be transmitted to the CAS server
Returns
void

Definition at line 1487 of file CAS.php.

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

1488  {
1491 
1492  if (!is_string($service)) {
1493  phpCAS :: error('type mismatched for parameter $service (should be `string\')');
1494  }
1495  self::$_PHPCAS_CLIENT->logout(array( "service" => $service ));
1496  // never reached
1498  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ logoutWithRedirectServiceAndUrl()

static phpCAS::logoutWithRedirectServiceAndUrl (   $service,
  $url 
)
static

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
string$servicea URL that will be transmitted to the CAS server
string$urla URL that will be transmitted to the CAS server
Returns
void
Deprecated:
The url parameter has been removed from the CAS server as of version 3.3.5.1

Definition at line 1537 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1538  {
1539  trigger_error('Function deprecated for cas servers >= 3.3.5.1', E_USER_DEPRECATED);
1542 
1543  if (!is_string($service)) {
1544  phpCAS :: error('type mismatched for parameter $service (should be `string\')');
1545  }
1546  if (!is_string($url)) {
1547  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1548  }
1549  self::$_PHPCAS_CLIENT->logout(
1550  array(
1551  "service" => $service,
1552  "url" => $url
1553  )
1554  );
1555  // never reached
1557  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ logoutWithUrl()

static phpCAS::logoutWithUrl (   $url)
static

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
string$urla URL that will be transmitted to the CAS server
Returns
void
Deprecated:
The url parameter has been removed from the CAS server as of version 3.3.5.1

Definition at line 1510 of file CAS.php.

References $url, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1511  {
1512  trigger_error('Function deprecated for cas servers >= 3.3.5.1', E_USER_DEPRECATED);
1514  if (!is_object(self::$_PHPCAS_CLIENT)) {
1515  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1516  }
1517  if (!is_string($url)) {
1518  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1519  }
1520  self::$_PHPCAS_CLIENT->logout(array( "url" => $url ));
1521  // never reached
1523  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
+ Here is the call graph for this function:

◆ renewAuthentication()

static phpCAS::renewAuthentication ( )
static

This method is called to renew the authentication.

Returns
void

Definition at line 1143 of file CAS.php.

References $auth, phpCAS\_validateClientExists(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1144  {
1147 
1148  $auth = self::$_PHPCAS_CLIENT->renewAuthentication();
1149 
1150  // store where the authentication has been checked and the result
1151  self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
1152 
1153  //self::$_PHPCAS_CLIENT->renewAuthentication();
1155  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
$auth
Definition: fileserver.php:48
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ retrievePT()

static phpCAS::retrievePT (   $target_service,
$err_code,
$err_msg 
)
static

Retrieve a Proxy Ticket from the CAS server.

Parameters
string$target_serviceUrl string of service to proxy
string&$err_codeerror code
string&$err_msgerror message
Returns
string Proxy Ticket

Definition at line 1624 of file CAS.php.

References phpCAS\_validateProxyExists(), and phpCAS\error().

1625  {
1627 
1628  try {
1629  return (self::$_PHPCAS_CLIENT->retrievePT($target_service, $err_code, $err_msg));
1630  } catch (Exception $e) {
1631  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1632  }
1633  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static retrievePT($target_service, &$err_code, &$err_msg)
Retrieve a Proxy Ticket from the CAS server.
Definition: CAS.php:1624
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
+ Here is the call graph for this function:

◆ setCacheTimesForAuthRecheck()

static phpCAS::setCacheTimesForAuthRecheck (   $n)
static

Set the times authentication will be cached before really accessing the CAS server in gateway mode:

  • -1: check only once, and then never again (until you pree login)
  • 0: always check
  • n: check every "n" time
Parameters
int$nan integer.
Returns
void

Definition at line 1010 of file CAS.php.

References $n, phpCAS\_validateClientExists(), and phpCAS\error().

1011  {
1013 
1014  try {
1015  self::$_PHPCAS_CLIENT->setCacheTimesForAuthRecheck($n);
1016  } catch (Exception $e) {
1017  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1018  }
1019  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
$n
Definition: RandomTest.php:85
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setCasAttributeParserCallback()

static phpCAS::setCasAttributeParserCallback (   $function,
array  $additionalArgs = array() 
)
static

Set a callback function to be run when receiving CAS attributes.

The callback function will be passed an $success_elements payload of the response () as its first parameter.

Parameters
string$functionCallback function
array$additionalArgsoptional array of arguments
Returns
void

Definition at line 1033 of file CAS.php.

References phpCAS\_validateClientExists().

1034  {
1036 
1037  self::$_PHPCAS_CLIENT->setCasAttributeParserCallback($function, $additionalArgs);
1038  }
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setCasServerCACert()

static phpCAS::setCasServerCACert (   $cert,
  $validate_cn = true 
)
static

Set the certificate of the CAS server CA and if the CN should be properly verified.

Parameters
string$certCA certificate file name
bool$validate_cnValidate CN in certificate (default true)
Returns
void

Definition at line 1644 of file CAS.php.

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

1645  {
1648 
1649  try {
1650  self::$_PHPCAS_CLIENT->setCasServerCACert($cert, $validate_cn);
1651  } catch (Exception $e) {
1652  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1653  }
1654 
1656  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setFixedCallbackURL()

static phpCAS::setFixedCallbackURL (   $url = '')
static

Set the fixed URL that will be used by the CAS server to transmit the PGT.

When this method is not called, a phpCAS script uses its own URL for the callback.

Parameters
string$urlthe URL
Returns
void

Definition at line 1568 of file CAS.php.

References $url, phpCAS\_validateProxyExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1569  {
1572 
1573  try {
1574  self::$_PHPCAS_CLIENT->setCallbackURL($url);
1575  } catch (Exception $e) {
1576  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1577  }
1578 
1580  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
+ Here is the call graph for this function:

◆ setFixedServiceURL()

static phpCAS::setFixedServiceURL (   $url)
static

Set the fixed URL that will be set as the CAS service parameter.

When this method is not called, a phpCAS script uses its own URL.

Parameters
string$urlthe URL
Returns
void

Definition at line 1590 of file CAS.php.

References $url, phpCAS\_validateProxyExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilSoapAuthenticationCAS\__buildAuth().

1591  {
1594 
1595  try {
1596  self::$_PHPCAS_CLIENT->setURL($url);
1597  } catch (Exception $e) {
1598  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1599  }
1600 
1602  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNoCasServerValidation()

static phpCAS::setNoCasServerValidation ( )
static

Set no SSL validation for the CAS server.

Returns
void

Definition at line 1663 of file CAS.php.

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

Referenced by ilAuthProviderCAS\doAuthentication(), and ilAuthContainerCAS\initCAS().

1664  {
1667 
1668  phpCAS :: trace('You have configured no validation of the legitimacy of the cas server. This is not recommended for production use.');
1669  self::$_PHPCAS_CLIENT->setNoCasServerValidation();
1671  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:599
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNoClearTicketsFromUrl()

static phpCAS::setNoClearTicketsFromUrl ( )
static

Disable the removal of a CAS-Ticket from the URL when authenticating DISABLING POSES A SECURITY RISK: We normally remove the ticket by an additional redirect as a security precaution to prevent a ticket in the HTTP_REFERRER or be carried over in the URL parameter.

Returns
void

Definition at line 1683 of file CAS.php.

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

1684  {
1687 
1688  self::$_PHPCAS_CLIENT->setNoClearTicketsFromUrl();
1690  }
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setPostAuthenticateCallback()

static phpCAS::setPostAuthenticateCallback (   $function,
array  $additionalArgs = array() 
)
static

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 the session-id to 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.

Parameters
string$functionCallback function
array$additionalArgsoptional array of arguments
Returns
void

Definition at line 1059 of file CAS.php.

References phpCAS\_validateClientExists().

1060  {
1062 
1063  self::$_PHPCAS_CLIENT->setPostAuthenticateCallback($function, $additionalArgs);
1064  }
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setServerLoginURL()

static phpCAS::setServerLoginURL (   $url = '')
static

Set the login URL of the CAS server.

Parameters
string$urlthe login URL
Returns
void
Since
0.4.21 by Wyman Chan

Definition at line 1324 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1325  {
1328 
1329  try {
1330  self::$_PHPCAS_CLIENT->setServerLoginURL($url);
1331  } catch (Exception $e) {
1332  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1333  }
1334 
1336  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setServerLogoutURL()

static phpCAS::setServerLogoutURL (   $url = '')
static

Set the logout URL of the CAS server.

Parameters
string$urlthe logout URL
Returns
void
Since
0.4.21 by Wyman Chan

Definition at line 1432 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1433  {
1436 
1437  try {
1438  self::$_PHPCAS_CLIENT->setServerLogoutURL($url);
1439  } catch (Exception $e) {
1440  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1441  }
1442 
1444  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setServerProxyValidateURL()

static phpCAS::setServerProxyValidateURL (   $url = '')
static

Set the proxyValidate URL of the CAS server.

Used for all CAS versions of proxy URL validations Examples: CAS 1.0 http://www.exemple.com/ CAS 2.0 http://www.exemple.com/proxyValidate CAS 3.0 http://www.exemple.com/p3/proxyValidate

Parameters
string$urlthe proxyValidate URL
Returns
void

Definition at line 1376 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1377  {
1380 
1381  try {
1382  self::$_PHPCAS_CLIENT->setServerProxyValidateURL($url);
1383  } catch (Exception $e) {
1384  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1385  }
1386 
1388  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setServerSamlValidateURL()

static phpCAS::setServerSamlValidateURL (   $url = '')
static

Set the samlValidate URL of the CAS server.

Parameters
string$urlthe samlValidate URL
Returns
void

Definition at line 1397 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1398  {
1401 
1402  try {
1403  self::$_PHPCAS_CLIENT->setServerSamlValidateURL($url);
1404  } catch (Exception $e) {
1405  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1406  }
1407 
1409  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setServerServiceValidateURL()

static phpCAS::setServerServiceValidateURL (   $url = '')
static

Set the serviceValidate URL of the CAS server.

Used for all CAS versions of URL validations. Examples: CAS 1.0 http://www.exemple.com/validate CAS 2.0 http://www.exemple.com/validateURL CAS 3.0 http://www.exemple.com/p3/serviceValidate

Parameters
string$urlthe serviceValidate URL
Returns
void

Definition at line 1350 of file CAS.php.

References $url, phpCAS\_validateClientExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1351  {
1354 
1355  try {
1356  self::$_PHPCAS_CLIENT->setServerServiceValidateURL($url);
1357  } catch (Exception $e) {
1358  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
1359  }
1360 
1362  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function:

◆ setSingleSignoutCallback()

static phpCAS::setSingleSignoutCallback (   $function,
array  $additionalArgs = array() 
)
static

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).

Parameters
string$functionCallback function
array$additionalArgsoptional array of arguments
Returns
void

Definition at line 1080 of file CAS.php.

References phpCAS\_validateClientExists().

1081  {
1083 
1084  self::$_PHPCAS_CLIENT->setSingleSignoutCallback($function, $additionalArgs);
1085  }
static _validateClientExists()
Checks if a client already exists.
Definition: CAS.php:1834
+ Here is the call graph for this function: