Hi!
I've tried setting up phpCAS to a Docker container with the romeoz/docker-nginx-php image hosting and serving the service. When trying the simple example from /docs, the redirect URL created by the CAS_Client class is faulty, causing me to be redirected to a 404 when I'd entered my credentials to the CAS server.
I should have been redirected to the HTTP-HOST, http://192.168.99.100:8080/docs/examples/example_simple.php?ticket=XXX (for me it is this as I run docker-machine and set up the docker container to port 8080), but the URL became http://app/docs/examples/example_simple.php?ticket=XXX.
After "debugging" I found out that the _getClientUrl-function gave me the wrong url. The client url is determined by this snippet (source/CAS/Client.php:3594):
if (empty($_SERVER['SERVER_NAME'])) {
$server_url = $_SERVER['HTTP_HOST'];
} else {
$server_url = $_SERVER['SERVER_NAME'];
}
Here the server name is prioritzed over the http host, but this resulted in the problem stated above. In my application the http host should be used instead, every time. Is there a reason for this logic or is this a simple mistake?
Hi!
I've tried setting up phpCAS to a Docker container with the romeoz/docker-nginx-php image hosting and serving the service. When trying the simple example from /docs, the redirect URL created by the CAS_Client class is faulty, causing me to be redirected to a 404 when I'd entered my credentials to the CAS server.
I should have been redirected to the HTTP-HOST,
http://192.168.99.100:8080/docs/examples/example_simple.php?ticket=XXX(for me it is this as I run docker-machine and set up the docker container to port 8080), but the URL becamehttp://app/docs/examples/example_simple.php?ticket=XXX.After "debugging" I found out that the
_getClientUrl-function gave me the wrong url. The client url is determined by this snippet (source/CAS/Client.php:3594):Here the server name is prioritzed over the http host, but this resulted in the problem stated above. In my application the http host should be used instead, every time. Is there a reason for this logic or is this a simple mistake?