18 require_once
'config.php';
51 <title>
phpCAS proxy example #2</title>
52 <link rel=
"stylesheet" type=
'text/css' href=
'example.css'/>
55 <h1>
phpCAS proxied proxy example</h1>
56 <?php require
'script_info.php' ?>
57 <p>the user
's login is <b><?php echo phpCAS::getUser(); ?></b>.</p> 58 <h2>Response from service <?php echo $serviceUrl; ?></h2> 62 // call a service and change the color depending on the result 64 $service = phpCAS::getProxiedService(PHPCAS_PROXIED_SERVICE_HTTP_GET); 65 $service->setUrl($serviceUrl); 67 if ($service->getResponseStatusCode() == 200) { 68 echo '<div
class=
"success">
'; 69 echo $service->getResponseBody(); 72 // The service responded with an error code 404, 500, etc. 73 echo '<div
class=
"error">
'; 74 echo 'The service responded with a
' 75 . $service->getResponseStatusCode() . ' error.
'; 78 } catch (CAS_ProxyTicketException $e) { 79 if ($e->getCode() == PHPCAS_SERVICE_PT_FAILURE) { 80 echo '<div
class=
"error">
'; 81 echo "Your login has timed out. You need to log in again."; 84 // Other proxy ticket errors are from bad request format (shouldn't happen)
static forceAuthentication()
static proxy($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true, \SessionHandlerInterface $sessionHandler=null)
static setLogger($logger=null)
static setVerbose($verbose)
static setNoCasServerValidation()