Subject: | Ticket validation broken with CAS 6.1.x |
Date: | Tue, 28 Jul 2020 15:09:56 +0200 |
To: | bug-AuthCAS [...] rt.cpan.org |
From: | Luis A. Martínez Sobrino <luis.martinez.sobrino [...] usc.gal> |
After moving from CAS 3.x to CAS 6.1.x our Sympa (Debian 9 package that
uses AuthCAS.pm 1.5) installation started failing CAS authentication.
Initial investigation showed that the problem was that AuthCAS was not
able to validate CAS tickets. Further investigation demonstrated that
CAS 6.1.x is returning the XML file with this code <?xml version="1.0"
encoding="ISO-8859-1"?>
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> in a single
line while AuthCAS expects them to be in separated lines.
*CAS 3.x XML*
<?xml version="1.0" encoding="ISO-8859-1"?>
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
<cas:authenticationSuccess>
<cas:user>...
*CAS 6.1.x XML*
<?xml version="1.0" encoding="ISO-8859-1"?><cas:serviceResponse
xmlns:cas='http://www.yale.edu/tp/cas'>
<cas:authenticationSuccess>
<cas:user>...
When we forced these tags to be in separated lines by adding the
following line to the _parse_xml sub in AuthCAS.pm the module started to
validate the tickets again as expected:
sub _parse_xml {
my $data = shift;
$data =~ s/"ISO-8859-1"\?>/"ISO-8859-1"\?>\n/g; #This line added
This is nothing but a patch to demonstrate a problem that should be
corrected by correctly parsing blank characters between tags. We have
not tested the latest version of AuthCAS, but we understand that the
problem should be present in version 1.7 since the code of the
_parse_xml sub is almost identical. A better solution could be the use
of an external module to fully parse the XML file instead of an
"internal" simple solution.
Thank you very much.
Best regards,
--
*Luis A. Martínez Sobrino*
Unidade de Sistemas
Área de Tecnoloxías da Información e das Comunicacións
Universidade de Santiago de Compostela