chdemko / joomla-external-login

The External Login project allows Joomla! to manage external Authentication Servers
GNU General Public License v2.0
30 stars 19 forks source link

CAS v3 URI Switching #34

Closed orware closed 7 years ago

orware commented 7 years ago

Hi Christophe,

Could you add in an option to switch between v2 and v3 CAS URLs please when configuring a CAS server?

I was testing out this PHP CAS Server here: https://github.com/leo108/php_cas_server

And the way he's implemented things seems like it might be following the protocol more specifically (he doesn't return that extra section in the response when I tested your plugin against it).

The standard seems to show that the only difference in the URIs is a /p3/ prefix added before the serviceValidate part.

I ran a small test by making a quick change into the CAS System Plugin here (line 238 or so):

curl_setopt($curl, CURLOPT_URL, $this->getUrl($params) . '/p3/serviceValidate?ticket=' . $ticket . '&service=' . urlencode($uri));

And during the next login attempt that CAS Server then returned the section automatically.

CAS URIs Reference: https://apereo.github.io/cas/4.2.x/protocol/CAS-Protocol-Specification.html#2-cas-uris https://apereo.github.io/cas/4.2.x/protocol/CAS-Protocol-Specification.html#28-p3servicevalidate-cas-30

I guess on the server implementation the builders can be strict and not return the CAS Attributes section as in the case above (the other product we've been using internally has been a CAS Server based off of the WSO2 product, which must be less strict and still returns the CAS attributes even though we're technically using the v2 protocol).

I still need to try out your other update from yesterday so hopefully I can get to that in a bit here.

chdemko commented 7 years ago

Fix in 3.1.1.0-beta1

orware commented 7 years ago

Thanks ;-)!