0

I integrated my ZendFramework 1 project with this example.

require_once 'Cas/config.php' ;
require_once 'Cas/CAS.php' ;
phpCAS::setDebug("/var/www/html/tums/library/Cas/ooo.log");
phpCAS::setVerbose(true);
phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
phpCAS::setNoCasServerValidation();
$auth = phpCAS::checkAuthentication();
if($auth)
    echo "Salam!";
else
{
    phpCAS::forceAuthentication();
    echo "bbbbbbbbbbbbbbbbbbbbbbb";
}

When User is not logged in phpCAS redirect to CAS login page properly but when User logged in phpCAS::checkAuthentication() repeats an infinite redirect loop until browser stop that. I run above example on a separate simple php file and it works fine but when i copy that code to my Zend Framework 1 controller this happens(infinite loop). What should i do?

Meysam Javadi
  • 1,374
  • 1
  • 10
  • 21

1 Answers1

1

As i found this conversation, i conclude that my project cannot remove ticket from URL and fall into an infinite redirect loop. Hence I added

phpCAS::setNoClearTicketsFromUrl();

and manually remove ticket from URL.

Meysam Javadi
  • 1,374
  • 1
  • 10
  • 21