phpCAS service validation URL is missing host/context

427 Views Asked by At

I'm using phpCAS with SAML. When I open the login URL I'm redirected to the idp and can login as usual. Upon redirect [successful login] phpCAS tries to use an incomplete URL to validate. It is missing the host / context https://idp.whatever.com/login_to_cas/here and only includes the serviceValidate/?ticket= portion.

I get this message:

Curl error: Could not resolve host: serviceValidate; Name or service not knownArray ( [url] => HTTP://serviceValidate/?ticket=[ticket]

The phpCAS log shows no error message, it ends at:

Redirect to : [idp url]/login?service=[referrer] [Client.php:1635] exit()

This is how I set up phpCAS in my script:

phpCAS::setDebug();
phpCAS::setVerbose(true);
phpCAS::client(SAML_VERSION_1_1, $cas_host, $cas_port, $cas_context);
phpCAS::setNoCasServerValidation();

if(!phpCAS::isAuthenticated()){
    phpCAS::forceAuthentication();
}

I've also tried adding: phpCAS::setServerServiceValidateURL('https://[host]/idp/[context]/serviceValidate/'); which made no difference.

I was able to use the exact same CASConfig.php / login setup in a different directory.

I've also tried making several changes to the source (checking the URL and replacing if it is incorrect) to no avail.

0

There are 0 best solutions below