Redirect results in an error: ill-formed ticket found in the URL
malcomm - January 12, 2007 - 20:08
| Project: | CAS |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
phpCAS error: phpCAS::client(): ill-formed ticket found in the URL (ticket=`ST-108-g3WzG6TbLyQMRGUTNImlZX3MbpwVjBTJDGY-20') in /var/www/drupal-5.0-rc2/modules/cas/cas.module on line 33
The URL coming back looks like this:
http://milo/drupal/?q=cas&ticket=ST-109-oqK7dG42Wnw6QqrI0MYfg1urAxXgeaaf...

#1
Versions:
drupal-5.0-rc2
PHP 5.1.2 (cli) (built: Nov 2 2006 12:29:42)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
CURL support enabled
CURL Information libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.2.3 libidn/0.5.18
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8a 11 Oct 2005
DOM/XML enabled
DOM/XML API Version 20031129
ZLib Support enabled
Compiled Version 1.2.3
Linked Version 1.2.3
#2
JA-SIG CAS 3.0.5
#3
Do you happen to have the version of the cas client?
#4
esup-phpcas 0.5.0-RC
#5
I've tried without much success to reproduce this. I think this is a problem with your PHP setup, but I'm not 100% sure. The test that's failing in the code is a preg_match function call to make sure that the ticket begins with an ST or a PT (which it clearly does according to your error message). Preg_match is doing a perl regular expression test to make this determination.
Here's a couple of possibilities:
* make sure your phpinfo reports that perl regular expressions are enabled.
* make sure magic quotes is turned of in your php config, this should be handled by the drupal .htaccess file, but if Apache allow overrides is not enabled (or you're using windows) those settings won't hold.
If you're not afraid of coding a little PHP, you might consider trying out the examples that ship with the esup php libraries to make sure this library is functioning properly in your environement.
If all this baffles you, post a copy of your phpinfo(); output so that I can look for other potential problems with your environment.
FYI: In case you hadn't figured this out, it's the esup php library that's throwing the error and not the drupal module.
#6
Was this issue resolved. I appear to be having the same problem but with version 6.x.
I have no problems with it when I have a hand compiled PHP but when I am using Zend Server, it fails. I get to the CAS server, login, and the ticket is passed back and it looks like the URL above.
http://servername/?q=cas&ticket=ST-1105-dYRWnbRfz1wTAmYPnfcP-cas2.server...
The only thing I've been able to determine is perhaps the phpCAS or the CAS module is looking for PHP in the wrong spot? Zend does not install in /etc instead it is /usr/local/zend/etc.
#7
Did you check phpinfo() page on your zend server to make sure that perl regular expressions are supported?
Dave