Commit b81d3270 authored by Laurent's avatar Laurent

hotline #94159 Skilleos : compatibility with last API

parent 954ac9c1
Pipeline #7910 failed with stage
in 32 minutes and 50 seconds
- ticket #94159 : connecteur Skilleos : mise à jour de l'API
\ No newline at end of file
......@@ -20,7 +20,7 @@
*/
class Skilleos_Config extends Class_DigitalResource_Config {
const SKILLEOS_URL = 'http://skilleos.com/sigb/sso/';
const SKILLEOS_URL = 'https://moncompte.skilleos.com/sign/cas';
protected function _getConfig() {
return [
......@@ -65,7 +65,7 @@ class Skilleos_Config extends Class_DigitalResource_Config {
protected function _getSsoUrl($user, $album) {
$id = $album
? $album->getIdOrigine()
? '/' . $album->getIdOrigine()
: '';
return static::SKILLEOS_URL . $id
......
......@@ -36,7 +36,8 @@ class Skilleos_Plugin_AuthController extends Class_DigitalResource_Controller {
$attributes = ['sn' => $user->getNom(),
'mail' => $user->getMail(),
'givenName' => $user->getPrenom()];
'givenName' => $user->getPrenom(),
'bibId' => $user->getLibelleBib()];
return $this->_helper->casValidResponse($user, $ticket, $attributes);
}
}
......
......@@ -74,7 +74,7 @@ class SkilleosModulesControllerUserWithGroupWithRightTest
public function shouldHaveAccessToSkilleosCas() {
Class_AdminVar::set('Skilleos_SSO_MODE', 'CAS');
$this->dispatch('/opac/modules/skilleos', true);
$this->assertContains('http://skilleos.com/sigb/sso/?casid=QUEST&ticket='.(new Class_CasTicket())->getTicketForCurrentUser(),
$this->assertContains('https://moncompte.skilleos.com/sign/cas?casid=QUEST&ticket='.(new Class_CasTicket())->getTicketForCurrentUser(),
$this->_response->getBody());
}
......@@ -100,7 +100,7 @@ class SkilleosModulesControllerUserWithGroupWithRightTest
$this->dispatch('/Skilleos_Plugin/auth/servicevalidate/service/skilleos/ticket/' . $ticket,
true);
$this->assertContains('<cas:user>666</cas:user>',$this->_response->getBody());
$this->assertContains('<cas:sn>jumper</cas:sn><cas:mail>jolly@jumper.com</cas:mail><cas:givenName>jolly</cas:givenName>',$this->_response->getBody());
$this->assertContains('<cas:sn>jumper</cas:sn><cas:mail>jolly@jumper.com</cas:mail><cas:givenName>jolly</cas:givenName><cas:bibId>Tombouctou</cas:bibId>',$this->_response->getBody());
}
......@@ -249,7 +249,8 @@ class SkilleosServiceHarvestTest extends SkilleosServiceTestCase {
/** @test */
public function urlOriginShouldBeSet() {
$this->assertEquals('http://skilleos.com/sigb/sso/', Class_Album::find(5)->getUrlOrigine());
$this->assertEquals('https://moncompte.skilleos.com/sign/cas',
Class_Album::find(5)->getUrlOrigine());
}
......@@ -341,7 +342,7 @@ class SkilleosServiceHarvestTest extends SkilleosServiceTestCase {
public function withAlbumIdShouldRedirectToSkilleos() {
$this->dispatch('/opac/modules/skilleos/album_id/6',true);
$ticket = (new Class_CasTicket())->getTicketForCurrentUser();
$this->assertXPathContentContains('//script','/sigb/sso/175?casid=QUEST&ticket='.$ticket, $this->_response->getBody());
$this->assertXPathContentContains('//script','/sign/cas/175?casid=QUEST&ticket='.$ticket, $this->_response->getBody());
}
}
......@@ -453,6 +454,6 @@ class SkilleosDashboardTrySsoTest extends SkilleosServiceTestCase {
/** @test */
public function shouldJavascriptRedirectToMoncompteDotSkilleos() {
$this->assertXPathContentContains('//script', 'document.location.href="http://skilleos.com/sigb/sso/?casid=QUEST&ticket');
$this->assertXPathContentContains('//script', 'document.location.href="https://moncompte.skilleos.com/sign/cas?casid=QUEST&ticket');
}
}
\ No newline at end of file
Markdown is supported
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