Skip to content
Snippets Groups Projects
Commit 78e9c1d8 authored by Laurent's avatar Laurent
Browse files

hotline #12422 base url for CAS should be unique

see http://www.jasig.org/cas/protocol#cas-uris
parent 28991b66
Branches
Tags
5 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!180Master,!175Master,!173Hotline#12422 Cas Ticket Format,!163Hotline#12422 Cas Ticket Format
......@@ -77,6 +77,12 @@ class AuthController extends ZendAfi_Controller_Action {
}
//see http://www.jasig.org/cas/protocol#cas-uris
function validateAction() {
$this->_forward('validate', 'cas-server');
}
function loginAction() {
$this->view->preferences = Class_Profil::getCurrentProfil()->getCfgModulesPreferences('auth','login');
$redirect = $this->_getParam('redirect', '/opac');
......
......@@ -49,6 +49,13 @@ class CasServerControllerValidateActionTest extends AbstractControllerTestCase {
}
/** @test */
public function requestWithInvalidTicketOnAuthShouldRespondInvalidTicketFailureXML() {
$this->dispatch('/opac/auth/validate?ticket=STmarchepo&service=http://test.com',true);
$this->assertContains('<cas:authenticationFailure code="INVALID_TICKET"> Ticket STmarchepo not recognized</cas:authenticationFailure>',$this->_response->getBody());
}
/** @test */
public function requestWithValidTicketShouldRespondValidXML() {
$this->dispatch('/opac/cas-server/validate?ticket='.md5(Zend_Session::getId().'300').'&service=http://test.com');
......@@ -62,6 +69,14 @@ class CasServerControllerValidateActionTest extends AbstractControllerTestCase {
$this->assertContains('<cas:user>300</cas:user>',$this->_response->getBody());
$this->assertContains('<cas:proxyGrantingTicket>',$this->_response->getBody());
}
/** @test */
public function requestWithValidTicketPrefixedBySTOnAuthenticateControllerShouldRespondValidXML() {
$this->dispatch('/opac/auth/validate?ticket=ST-'.md5(Zend_Session::getId().'300').'&service=http://test.com');
$this->assertContains('<cas:user>300</cas:user>',$this->_response->getBody());
$this->assertContains('<cas:proxyGrantingTicket>',$this->_response->getBody());
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment