apereo / phpCAS

Apereo PHP CAS Client

Home Page:https://apereo.github.io/phpCAS/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Endless Loop, ticket not found

PierreMaurer opened this issue · comments

Hello !

I am trying to use PHPCAS with LemonLDAP.

When a go on my application I have a endless loop between

https://test_cas.domain.local/?ticket=ST-ada9fa6c1e14f569bcaccce5fb16956e26bb68bda1ad0cf6704fbab053cd4c04
and
https://lemonldap.domain.local/cas/login?service=https%3A%2F%2Ftest_cas.domain.local%2F

I think the problem is when the application is redirect with the ticket, PHPCAS doesn't found the ticket and request a new ticket to the CAS SERVER but i am not sure and i don't know how fix that.

When i make a
curl -k https://lemonldap.domain.local/cas/serviceValidate

I got a
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> <cas:authenticationFailure code="INVALID_REQUEST"> Missing mandatory parameters (service, ticket) </cas:authenticationFailure> </cas:serviceResponse>
Application code:

`<?php

require_once 'config.php';
require_once 'vendor/autoload.php';
phpCAS::setLogger();
phpCAS::setDebug();
phpCAS::setVerbose(true);
// Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, 'lemonldap.domain.local', 443, '/cas', True);

phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();

// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
?>
`
Thank's for your help :)

phpcas_log.log

commented

My guess is that your PHP environment is weird. This is simply PHP not recognizing the GET ticket parameter at all.

You can try with replacing that whole file with

<?php
phpinfo();

and then visit https://test_cas.domain.local/?ticket=ST-ada9fa6c1e14f569bcaccce5fb16956e26bb68bda1ad0cf6704fbab053cd4c04 directly. See if you can observe the ticket parameter in one of the sections on the info output.

Hello,

Thank's for your help.

I remplaced the whole php file by the phpinfo and i got the ticket in
$_SERVER['REQUEST_URI'] /?ticket=ST-ada9fa6c1e14f569bcaccce5fb16956e26bb68bda1ad0cf6704fbab053cd4c04

I think the problem come from my php environment because i try with nodeJS and work with it.

commented

I finally got a chance to try this myself. To double check, you are saying you don't have $_GET['ticket'] as well as $_REQUEST['ticket'] on that page, under "PHP Variabless"?

Exactly, under "PHP Variables" I just have $_SERVER['REQUEST_URI'] and i don't have $_GET['ticket']

And i just see, the variable name is Request_URI and not ticket

commented

Thanks. I'd recommend you try with another PHP environment and maybe go from there. Closing as there's really nothing a library van do realistically here.