Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong documentation in code and example for URL validation. #215

Closed
erozqba opened this issue Dec 16, 2016 · 1 comment
Closed

Wrong documentation in code and example for URL validation. #215

erozqba opened this issue Dec 16, 2016 · 1 comment

Comments

@erozqba
Copy link
Contributor

erozqba commented Dec 16, 2016

Hi,
I was looking in the example_custom_urls.php file to know how to made a patch for this issue XavRsl/Cas#37 in another project that uses phpCAS and I find out that the comments are a little confusing:

In the line https://github.com/Jasig/phpCAS/blob/master/docs/examples/example_custom_urls.php#L39 it suggest that you should use phpCAS::setServerProxyValidateURL for any CAS 2.0 validation, but phpCAS::setServerProxyValidateURL should be used for the proxy validate URL of any CAS version.

In the line https://github.com/Jasig/phpCAS/blob/master/docs/examples/example_custom_urls.php#L41 it suggest that you should use phpCAS::setServerServiceValidateURL for any CAS 1.0 validation, but phpCAS::setServerServiceValidateURL should be used for the validate URL of any CAS version.

After looking more into the implementation I found a similar problem in https://github.com/Jasig/phpCAS/blob/master/source/CAS.php file in lines
https://github.com/Jasig/phpCAS/blob/master/source/CAS.php#L1315 and
https://github.com/Jasig/phpCAS/blob/master/source/CAS.php#L1337

For references look at the CAS protocol specifications https://apereo.github.io/cas/5.0.x/protocol/CAS-Protocol-Specification.html
and to the implementations in the https://github.com/Jasig/phpCAS/blob/master/source/CAS/Client.php file, of the methods getServerServiceValidateURL in line https://github.com/Jasig/phpCAS/blob/master/source/CAS/Client.php#L431 and getServerProxyValidateURL in line https://github.com/Jasig/phpCAS/blob/master/source/CAS/Client.php#L488

@jfritschi
Copy link
Contributor

Thanks for the report and fix. We fixed the "broken" code long ago but forgot the inline documentation...

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants