Functions

Authentication
[User interface]

Functions

static phpCAS::setCacheTimesForAuthRecheck ($n)
static phpCAS::setPostAuthenticateCallback ($function, array $additionalArgs=array())
static phpCAS::setSingleSignoutCallback ($function, array $additionalArgs=array())
static phpCAS::checkAuthentication ()
static phpCAS::forceAuthentication ()
static phpCAS::renewAuthentication ()
static phpCAS::isAuthenticated ()
static phpCAS::isSessionAuthenticated ()
static phpCAS::getUser ()
static phpCAS::getAttributes ()
static phpCAS::hasAttributes ()
static phpCAS::hasAttribute ($key)
static phpCAS::getAttribute ($key)
static phpCAS::handleLogoutRequests ($check_client=true, $allowed_clients=false)
static phpCAS::getServerLoginURL ()
static phpCAS::setServerLoginURL ($url= '')
static phpCAS::setServerServiceValidateURL ($url= '')
static phpCAS::setServerProxyValidateURL ($url= '')
static phpCAS::setServerSamlValidateURL ($url= '')
static phpCAS::getServerLogoutURL ()
static phpCAS::setServerLogoutURL ($url= '')
static phpCAS::logout ($params="")
static phpCAS::logoutWithRedirectService ($service)
static phpCAS::logoutWithUrl ($url)
static phpCAS::logoutWithRedirectServiceAndUrl ($service, $url)
static phpCAS::setFixedCallbackURL ($url= '')
static phpCAS::setFixedServiceURL ($url)
static phpCAS::getServiceURL ()
static phpCAS::retrievePT ($target_service, &$err_code, &$err_msg)
static phpCAS::setCasServerCACert ($cert)
static phpCAS::setNoCasServerValidation ()
static phpCAS::setNoClearTicketsFromUrl ()

Function Documentation

static phpCAS::checkAuthentication (  )  [static, inherited]

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
Examples:
example_gateway.php.

Definition at line 1045 of file CAS.php.

References $auth, phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::forceAuthentication (  )  [static, inherited]
static phpCAS::getAttribute ( key  )  [static, inherited]

Answer an attribute for the authenticated user.

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

Definition at line 1270 of file CAS.php.

static phpCAS::getAttributes (  )  [static, inherited]

Answer attributes about the authenticated user.

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

Definition at line 1202 of file CAS.php.

static phpCAS::getServerLoginURL (  )  [static, inherited]

This method returns the URL to be used to login. or phpCAS::isAuthenticated().

Returns:
the login name of the authenticated user

Definition at line 1301 of file CAS.php.

static phpCAS::getServerLogoutURL (  )  [static, inherited]

This method returns the URL to be used to login. or phpCAS::isAuthenticated().

Returns:
the login name of the authenticated user

Definition at line 1397 of file CAS.php.

References phpCAS::error().

static phpCAS::getServiceURL (  )  [static, inherited]

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

Definition at line 1569 of file CAS.php.

References phpCAS::error().

static phpCAS::getUser (  )  [static, inherited]

This method returns the CAS user's login name.

Warning:
should not be called only after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Returns:
the login name of the authenticated user
Examples:
example_advanced_saml11.php, and example_lang.php.

Definition at line 1180 of file CAS.php.

Referenced by phpCAS::forceAuthentication().

static phpCAS::handleLogoutRequests ( check_client = true,
allowed_clients = false 
) [static, inherited]

Handle logout requests.

Examples:
example_advanced_saml11.php, and example_logout.php.

Definition at line 1287 of file CAS.php.

static phpCAS::hasAttribute ( key  )  [static, inherited]

Answer true if an attribute exists for the authenticated user.

Warning:
should not be called only after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Parameters:
string $key
Returns:
boolean

Definition at line 1247 of file CAS.php.

static phpCAS::hasAttributes (  )  [static, inherited]

Answer true if there are attributes for the authenticated user.

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

Definition at line 1224 of file CAS.php.

static phpCAS::isAuthenticated (  )  [static, inherited]

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 1135 of file CAS.php.

static phpCAS::isSessionAuthenticated (  )  [static, inherited]

Checks whether authenticated based on $_SESSION. Useful to avoid server calls.

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

Definition at line 1165 of file CAS.php.

static phpCAS::logout ( params = ""  )  [static, inherited]

This method is used to logout from CAS. $params an array that contains the optional url and service parameters that will be passed to the CAS server

Examples:
example_custom_urls.php, example_gateway.php, and example_simple.php.

Definition at line 1430 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::logoutWithRedirectService ( service  )  [static, inherited]

This method is used to logout from CAS. Halts by redirecting to the CAS server.

Parameters:
$service a URL that will be transmitted to the CAS server

Definition at line 1460 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::logoutWithRedirectServiceAndUrl ( service,
url 
) [static, inherited]

This method is used to logout from CAS. Halts by redirecting to the CAS server.

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

Definition at line 1504 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::logoutWithUrl ( url  )  [static, inherited]

This method is used to logout from CAS. Halts by redirecting to the CAS server.

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

Definition at line 1481 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::renewAuthentication (  )  [static, inherited]

This method is called to renew the authentication.

Definition at line 1107 of file CAS.php.

static phpCAS::retrievePT ( target_service,
&$  err_code,
&$  err_msg 
) [static, inherited]

Retrieve a Proxy Ticket from the CAS server.

Definition at line 1580 of file CAS.php.

References phpCAS::error().

static phpCAS::setCacheTimesForAuthRecheck ( n  )  [static, inherited]

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:
$n an integer.

Definition at line 979 of file CAS.php.

References phpCAS::error().

static phpCAS::setCasServerCACert ( cert  )  [static, inherited]

Set the certificate of the CAS server CA.

Parameters:
$cert the CA certificate
Examples:
example_advanced_saml11.php.

Definition at line 1596 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setFixedCallbackURL ( url = ''  )  [static, inherited]

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:
$url the URL

Definition at line 1531 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setFixedServiceURL ( url  )  [static, inherited]

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:
$url the URL

Definition at line 1553 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setNoCasServerValidation (  )  [static, inherited]
static phpCAS::setNoClearTicketsFromUrl (  )  [static, inherited]

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

Definition at line 1629 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

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

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:
callback $function
optional array $additionalArgs
Returns:
void

Definition at line 1008 of file CAS.php.

References phpCAS::error().

static phpCAS::setServerLoginURL ( url = ''  )  [static, inherited]

Set the login URL of the CAS server.

Parameters:
$url the login URL
Since:
0.4.21 by Wyman Chan

Definition at line 1314 of file CAS.php.

static phpCAS::setServerLogoutURL ( url = ''  )  [static, inherited]

Set the logout URL of the CAS server.

Parameters:
$url the logout URL
Since:
0.4.21 by Wyman Chan

Definition at line 1410 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setServerProxyValidateURL ( url = ''  )  [static, inherited]

Set the proxyValidate URL of the CAS server. Used for all CAS 2.0 validations

Parameters:
$url the proxyValidate URL
Since:
1.1.0 by Joachim Fritschi
Examples:
example_custom_urls.php.

Definition at line 1356 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setServerSamlValidateURL ( url = ''  )  [static, inherited]

Set the samlValidate URL of the CAS server.

Parameters:
$url the samlValidate URL
Since:
1.1.0 by Joachim Fritschi

Definition at line 1376 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

static phpCAS::setServerServiceValidateURL ( url = ''  )  [static, inherited]

Set the serviceValidate URL of the CAS server. Used only in CAS 1.0 validations

Parameters:
$url the serviceValidate URL
Since:
1.1.0 by Joachim Fritschi

Definition at line 1335 of file CAS.php.

References phpCAS::error(), phpCAS::traceBegin(), and phpCAS::traceEnd().

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

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:
callback $function
optional array $additionalArgs
Returns:
void

Definition at line 1030 of file CAS.php.

References phpCAS::error().