4 * Example for a proxy that rebroadcasts all PGTs to different servers in the
9 * @file example_proxy_rebroadcast.php
10 * @category Authentication
12 * @author Joachim Fritschi <jfritschi@freenet.de>
13 * @author Adam Franco <afranco@middlebury.edu>
14 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
15 * @link https://wiki.jasig.org/display/CASC/phpCAS
18 // Load the settings from the central config file
19 require_once 'config.php';
21 require_once $phpcas_path . '/CAS.php';
27 phpCAS::proxy(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
29 // For production use set the CA certificate that is the issuer of the cert
30 // on the CAS server and uncomment the line below
31 // phpCAS::setCasServerCACert($cas_server_ca_cert_path);
33 // For quick testing you can disable SSL validation of the CAS server.
34 // THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
35 // VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
36 phpCAS::setNoCasServerValidation();
38 // Set the nodes for rebroadcasting pgtIou/pgtId and logoutRequest
39 phpCAS::addRebroadcastNode($rebroadcast_node_1);
40 phpCAS::addRebroadcastNode($rebroadcast_node_2);
42 // handle incoming logout requests
43 phpCAS::handleLogoutRequests();
45 // force CAS authentication
46 phpCAS::forceAuthentication();
48 // at this step, the user has been authenticated by the CAS server
49 // and the user's login name can be read with phpCAS::getUser().
54 <title>phpCAS proxy rebroadcast example</title>
55 <link rel="stylesheet" type='text/css' href='example.css'/>
58 <h1>phpCAS proxy rebroadcast example</h1>
59 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>