This method is used to retrieve PT's from the CAS server thanks to a PGT.
public retrievePT ( string $target_service, &$err_code, &$err_msg ) : a | ||
$target_service | string | the service to ask for with the PT. |
return | a | Proxy Ticket, or false on error. |
/** * Test that we can at least retrieve a proxy-ticket for the service. * * @return void */ public function testRetrievePT() { $pt = $this->object->retrievePT('http://www.service.com/my_webservice', $err_code, $err_msg); $this->assertEquals('PT-asdfas-dfasgww2323radf3', $pt); }
/** * Test that we can at least retrieve a proxy-ticket for the service. * * @return void */ public function testRetrievePT() { $pt = $this->object->retrievePT('imap://mail.example.edu/path/to/something', $err_code, $err_msg); $this->assertEquals('PT-asdfas-dfasgww2323radf3', $pt); }
/** * Retrieve a Proxy Ticket from the CAS server. * * @param string $target_service Url string of service to proxy * @param string &$err_code error code * @param string &$err_msg error message * * @return string Proxy Ticket */ public static function retrievePT($target_service, &$err_code, &$err_msg) { phpCAS::_validateProxyExists(); try { return self::$_PHPCAS_CLIENT->retrievePT($target_service, $err_code, $err_msg); } catch (Exception $e) { phpCAS::error(get_class($e) . ': ' . $e->getMessage()); } }