The auth is CAS ... The error is LDAP!

The auth is CAS ... The error is LDAP!

by S s -
Number of replies: 5

Hey guys,

I am using moodle 1.9 and I set the auth to CAS and connected to a CAS server. Once I hit login, I get the following moodle error:

LDAP-module cannot connect to any servers:

I don't know what does LDAP have to do with this...any help would be much appreciated !

Thanks in advance ;)

Average of ratings: -
In reply to S s

Re: The auth is CAS ... The error is LDAP!

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you are using a 1.9 version prior to 2010.09.25 (you can check your version.php file, the build date specified in $release) then CAS authentication needed a LDAP server configured to work.

From that date on it's optional (but you won't be able to automatically retrieve additonal user information, like email, first name, etc. from an external source)

Saludos.
Iñaki.
In reply to Iñaki Arenaza

Re: The auth is CAS ... The error is LDAP!

by S s -

Thank You very much it works now! smile smile

In reply to Iñaki Arenaza

Re: The auth is CAS ... The error is LDAP!

by Iván Vázquez -

Hi Iñaki,

I'm using Moodle 2.2.2+ and I want to use a CAS server to authenticate my users. How can I configure it if I don't want to use a LDAP server? I only need the data of the response of the CAS server, the XML file. Do you know if it's possible? And if don't, do you know any module that supports this behaviour?

Thanks a lot.

Iván

In reply to Iván Vázquez

Re: The auth is CAS ... The error is LDAP!

by Iván Vázquez -

Hi again.

I had a problem with my server. I tried the same in a local installation and it works. I configured CAS without LDAP simply filling the CAS configuration fields and not the LDAP ones. But I have a new problem.

- CAS server sends me an HTML with an XML embedded and the error I get is the next:

Warning: DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding ! Bytes: 0xF1 0x65 0x63 0x65 in Entity, line: 3 in /var/www/moodletest/auth/cas/CAS/CAS/domxml-php4-to-php5.php on line 72

CAS Authentication failed!

You were not authenticated.

You may submit your request again by clicking here.

If the problem persists, you may contact the administrator of this site.


phpCAS 1.1.3 using server https://myserver/cas/ (CAS 2.0)

 

- The header of the response is this:

HTTP/1.1 200 OK

Date: Thu, 12 Apr 2012 12:39:24 GMT

Content-Type: text/html;charset=ISO-8859-1

Content-Language: gl

Vary: Accept-Encoding

Content-Encoding: gzip

Content-Length: 306

Keep-Alive: timeout=15, max=99

Connection: Keep-Alive

 

- The HTML is:

<html>

<head></head>

<body>

<cas:serviceresponse xmlns:cas="http://www.yale.edu/tp/cas">

<cas:authenticationsuccess>

<cas:user>XXXXXX@XXX.XX</cas:user>

<cas:attributes>

<cas:employeetype>EXT</cas:employeetype>

<cas:userprincipalname>XXXXXX@XXX.XX</cas:userprincipalname>

<cas:sn>XXXXXX XXXXX</cas:sn>

<cas:employeeid>XXXXXXXXX</cas:employeeid>

<cas:cn>XXXXX XXXXX XXXXX</cas:cn>

<cas:givenname>XXXXX</cas:givenname>

<cas:tipoautenticacion>Formulario</cas:tipoautenticacion>

</cas:attributes>

</cas:authenticationsuccess>

</cas:serviceresponse>

</body>

</html>

 

Is this a normal response of the CAS server? Or the module is not prepared for this case?

Thanks.

Iván.

 

In reply to Iván Vázquez

Re: The auth is CAS ... The error is LDAP!

by Iván Vázquez -

Hi,

I solved the encoding error changing a function in domxml-php4-to-php5.php. I added this:

$str=utf8_encode($str);

in "function domxml_open_mem($str,$mode=DOMXML_LOAD_PARSING,&$error=null)" before the sentence:

if (!$dom->myDOMNode->loadXML($str)) $dom=null;

So this way I encode the XML to utf-8. It works for me.

But now I have another question. I want to map an attribute of the CAS response to the "idnumber" attribute of the user I am connecting with. I had a look to the code but, I did not get the solution yet.

Any ideas?

Thanks.