XavRsl / Cas

CAS server SSO authentication in Laravel 4.x & 5.x
MIT License
77 stars 36 forks source link

ErrorException DOMDocument::loadXML() with Cas login and redirect in laravel5 #24

Open danhe opened 9 years ago

danhe commented 9 years ago

Hello, I have some problems with cas login, now i can get the page of login with cas, but when i click the button login, i meet some problems: ErrorException in Client.php line 3137: DOMDocument::loadXML(): Space required after the Public Identifier in Entity, line: 1 at HandleExceptions->handleError('2', 'DOMDocument::loadXML(): Space required after the Public Identifier in Entity, line: 1', '/var/www/html/private/vendor/jasig/phpcas/source/CAS/Client.php', '3137', array('validate_url' => 'https://login.unice.fr/serviceValidate?service=http%3A%2F%2Flocalhost%2Fprivate%2Fpublic%2Flogin&ticket=ST-1903829-FIC9heJrTXUTsXqF7qTc-login.unice.fr', 'text_response' => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 302 Found

Found

The document has moved here.

', 'tree_response' => null, 'result' => false, 'headers' => array('HTTP/1.1 302 Found ', 'Date: Mon, 20 Jul 2015 13:03:24 GMT ', 'Server: Apache ', 'Location: https://login.unice.fr/loginserviceValidate?service=http%3A%2F%2Flocalhost%2Fprivate%2Fpublic%2Flogin&ticket=ST-1903829-FIC9heJrTXUTsXqF7qTc-login.unice.fr ', 'Content-Length: 343 ', 'Connection: close ', 'Content-Type: text/html; charset=iso-8859-1 ', ' '), 'err_msg' => '', 'this' => object(CAS_Client), 'dom' => object(DOMDocument)))

I don't know how to resolve it , and after that i cann't get the informations of the user with Cas::user() or Cas::getCurrentUser(), i need your help , thanks..

XavRsl commented 9 years ago

Hard to tell... There seems to be a problem in your config. The location of the serviceValidate URL in your exemple seems to be wrong (loginserviceValidate instead of serviceValidate). And, your service is a localhost, which could represent a validation problem (I don't know about Nice University, but here in Versailles, we allow only domain specific URLs). And, your URL includes "public", which should not be used as is in Laravel, but should be re-written by your HTTP server. Could you also use the "code syntax" in the github editor so that the code is easier to read ? Hope this helps....

Xavier