• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • Examples
  • File List
  • File Members

docs/examples/example_custom_urls.php

Go to the documentation of this file.
00001 <?php
00002 
00003 //
00004 // phpCAS client with custom validation urls
00005 //
00006 
00007 // import phpCAS lib
00008 include_once('CAS.php');
00009 
00010 phpCAS::setDebug();
00011 
00012 // initialize phpCAS
00013 phpCAS::client(CAS_VERSION_2_0,'sso.hrz.tu-darmstadt.de',443,'');
00014 // Override the validation url for any (ST and PT) CAS 2.0 validation
00015 phpCAS::setServerProxyValidateURL('https://sso.hrz.tu-darmstadt.de:1443/proxyValidate');
00016 // Override the validation url for any CAS 1.0 validation
00017 //phpCAS::setServerServiceValidateURL('https://sso.hrz.tu-darmstadt.de:1443/serviceValidate');
00018 //Override the validation url for any SAML11 validation
00019 //phpCAS::setServerSamlValidateURL('https://sso.hrz.tu-darmstadt.de:1443/samlValidate');
00020 
00021 
00022 // no SSL validation for the CAS server
00023 phpCAS::setNoCasServerValidation();
00024 
00025 // force CAS authentication
00026 phpCAS::forceAuthentication();
00027 
00028 // at this step, the user has been authenticated by the CAS server
00029 // and the user's login name can be read with phpCAS::getUser().
00030 
00031 // logout if desired
00032 if (isset($_REQUEST['logout'])) {
00033         phpCAS::logout();
00034 }
00035 
00036 // for this test, simply print that the authentication was successfull
00037 ?>
00038 <html>
00039   <head>
00040     <title>phpCAS simple client</title>
00041   </head>
00042   <body>
00043     <h1>Successfull Authentication!</h1>
00044     <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
00045     <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
00046     <p><a href="?logout=">Logout</a></p>
00047   </body>
00048 </html>

Generated on Mon Oct 4 2010 08:11:25 for phpCAS by  doxygen 1.7.1