8
include_once('CAS.php');
14
phpCAS::proxy(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
16
// no SSL validation for the CAS server
17
phpCAS::setNoCasServerValidation();
19
// force CAS authentication
20
phpCAS::forceAuthentication();
22
// at this step, the user has been authenticated by the CAS server
23
// and the user's login name can be read with phpCAS::getUser().
25
// moreover, a PGT was retrieved from the CAS server that will
26
// permit to gain accesses to new services.
31
<title>phpCAS proxy example</title>
34
<h1>phpCAS proxy example</h1>
35
<p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
37
// access to external services
38
$services = array('http://phpcas-test.ifsic.univ-rennes1.fr/examples/example_service.php',
39
'http://phpcas-test.ifsic.univ-rennes1.fr/examples/example_proxy2.php',
40
'http://www.ifsic.univ-rennes1.fr/xxx');
41
foreach ( $services as $service ) {
42
echo '<h2>Response from service '.$service.'</h2><ul><hr>';
44
// call the service and change the color depending on the result
45
if ( phpCAS::serviceWeb($service,$err_code,$output) ) {
46
echo '<font color="#00FF00">';
48
echo '<font color="#FF0000">';
51
echo '</font><hr></ul>';