example_proxy.php
<?php
include_once('CAS.php');
phpCAS::setDebug();
phpCAS::proxy(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
?>
<html>
<head>
<title>phpCAS proxy example</title>
</head>
<body>
<h1>phpCAS proxy example</h1>
<p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
<?php
// access to external services
$services = array('http:
'http://phpcas-test.ifsic.univ-rennes1.fr/examples/example_proxy2.php',
'http://www.ifsic.univ-rennes1.fr/xxx');
foreach ( $services as $service ) {
echo '<h2>Response from service '.$service.'</h2><ul><hr>';
flush();
if ( phpCAS::serviceWeb($service,$err_code,$output) ) {
echo '<font color="#00FF00">';
} else {
echo '<font color="#FF0000">';
}
echo $output;
echo '</font><hr></ul>';
}
?>
</body>
</html>