- Code: Select all
<?php
//
// phpCAS proxied client (service) with sessioning
//
// import phpCAS lib
include_once('CAS.php');
// set debug mode
phpCAS::setDebug();
echo "heelo";
// initialize phpCAS
phpCAS::client(CAS_VERSION_2_0,'login.unl.edu',443,'/cas');
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();
//phpCAS::isAuthenticated();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// for this test, simply print that the authentication was successfull
echo '<p>The user\'s login is <b>'.phpCAS::getUser().'</b>.</p>';
// increment the number of requests of the session and print it
echo '<p>request #'.(++$_SESSION\['n'\]).'</p>';
?>
When entering the site, it works well, redirecting to login.unl.edu/cas. However after the login, the system gets caught in a loop. phpCAS::forceAuthenication() is the culprit. phpCAS::isAuthenticated() always returns false . What is my problem?
http://engineering.unl.edu/test/alex.php

