ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
CAS proxied client features (CAS 2.0, Proxy Tickets)
+ Collaboration diagram for CAS proxied client features (CAS 2.0, Proxy Tickets):

Functions

 CASClient::getPT ()
 This method returns the Proxy Ticket provided in the URL of the request.
 CASClient::setPT ($pt)
 This method stores the Proxy Ticket.
 CASClient::hasPT ()
 This method tells if a Proxy Ticket was stored.
 CASClient::getSA ()
 This method returns the SAML Ticket provided in the URL of the request.
 CASClient::setSA ($sa)
 This method stores the SAML Ticket.
 CASClient::hasSA ()
 This method tells if a SAML Ticket was stored.
 CASClient::validatePT (&$validate_url, &$text_response, &$tree_response)
 This method is used to validate a ST or PT; halt on failure Used for all CAS 2.0 validations.

Variables

 CASClient::$_pt
 the Proxy Ticket provided in the URL of the request if present (empty otherwise).

Detailed Description

Function Documentation

CASClient::getPT ( )
private

This method returns the Proxy Ticket provided in the URL of the request.

Returns
The proxy ticket.

Definition at line 2445 of file client.php.

Referenced by CASClient\isAuthenticated().

{
// return 'ST'.substr($this->_pt, 2);
return $this->_pt;
}

+ Here is the caller graph for this function:

CASClient::getSA ( )
private

This method returns the SAML Ticket provided in the URL of the request.

Returns
The SAML ticket.

Definition at line 2471 of file client.php.

Referenced by CASClient\isAuthenticated().

{ return 'ST'.substr($this->_sa, 2); }

+ Here is the caller graph for this function:

CASClient::hasPT ( )
private

This method tells if a Proxy Ticket was stored.

Returns
TRUE if a Proxy Ticket has been stored.

Definition at line 2464 of file client.php.

Referenced by CASClient\isAuthenticated().

{ return !empty($this->_pt); }

+ Here is the caller graph for this function:

CASClient::hasSA ( )
private

This method tells if a SAML Ticket was stored.

Returns
TRUE if a SAML Ticket has been stored.

Definition at line 2487 of file client.php.

Referenced by CASClient\isAuthenticated().

{ return !empty($this->_sa); }

+ Here is the caller graph for this function:

CASClient::setPT (   $pt)
private

This method stores the Proxy Ticket.

Parameters
$ptThe Proxy Ticket.

Definition at line 2456 of file client.php.

Referenced by CASClient\wasPreviouslyAuthenticated().

{ $this->_pt = $pt; }

+ Here is the caller graph for this function:

CASClient::setSA (   $sa)
private

This method stores the SAML Ticket.

Parameters
$saThe SAML Ticket.

Definition at line 2479 of file client.php.

{ $this->_sa = $sa; }
CASClient::validatePT ( $validate_url,
$text_response,
$tree_response 
)
private

This method is used to validate a ST or PT; halt on failure Used for all CAS 2.0 validations.

Returns
bool TRUE when successfull, halt otherwise by calling CASClient::authError().

Definition at line 2506 of file client.php.

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

Referenced by CASClient\isAuthenticated().

{
// build the URL to validate the ticket
$validate_url = $this->getServerProxyValidateURL().'&ticket='.$this->getPT();
if ( $this->isProxy() ) {
// pass the callback url for CAS proxies
$validate_url .= '&pgtUrl='.urlencode($this->getCallbackURL());
}
// open and read the URL
if ( !$this->readURL($validate_url,''/*cookies*/,$headers,$text_response,$err_msg) ) {
phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')');
$this->authError('PT not validated',
$validate_url,
TRUE/*$no_response*/);
}
// read the response of the CAS server into a DOM object
if ( !($dom = domxml_open_mem($text_response))) {
// read failed
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
TRUE/*$bad_response*/,
$text_response);
}
// read the root node of the XML tree
if ( !($tree_response = $dom->document_element()) ) {
// read failed
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
TRUE/*$bad_response*/,
$text_response);
}
// insure that tag name is 'serviceResponse'
if ( $tree_response->node_name() != 'serviceResponse' ) {
// bad root node
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
TRUE/*$bad_response*/,
$text_response);
}
if ( sizeof($arr = $tree_response->get_elements_by_tagname("authenticationSuccess")) != 0) {
// authentication succeded, extract the user name
if ( sizeof($arr = $tree_response->get_elements_by_tagname("user")) == 0) {
// no user specified => error
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
TRUE/*$bad_response*/,
$text_response);
}
$this->setUser(trim($arr[0]->get_content()));
} else if ( sizeof($arr = $tree_response->get_elements_by_tagname("authenticationFailure")) != 0) {
// authentication succeded, extract the error code and message
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
FALSE/*$bad_response*/,
$text_response,
$arr[0]->get_attribute('code')/*$err_code*/,
trim($arr[0]->get_content())/*$err_msg*/);
} else {
$this->authError('PT not validated',
$validate_url,
FALSE/*$no_response*/,
TRUE/*$bad_response*/,
$text_response);
}
$this->renameSession($this->getPT());
// at this step, PT has been validated and $this->_user has been set,
phpCAS::traceEnd(TRUE);
return TRUE;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

CASClient::$_pt
private

the Proxy Ticket provided in the URL of the request if present (empty otherwise).

Written by CASClient::CASClient(), read by CASClient::getPT() and CASClient::hasPGT().

Definition at line 2438 of file client.php.