Skip to content
Snippets Groups Projects
Commit ce09194d authored by Alex Arnaud's avatar Alex Arnaud
Browse files

hotline#181223 : Identity Provider : connection to Bokeh CAS v3 throw error

parent c5e94094
Branches
Tags
1 merge request!4762[RTKo] hotline#181223 : Identity Provider : connection to Bokeh CAS v3 throw error
Pipeline #23979 passed with stage
in 21 minutes and 23 seconds
- correctif #181223 : Administration: correction de la connexion via les fournisseur d'identité en CAS3
\ No newline at end of file
......@@ -33,6 +33,11 @@ class Class_WebService_Cas3 extends Class_WebService_Cas2 {
? $this->_getValueForIdSite($body, $key)
: $this->_getMappingValue($body, $key);
$valid_params = array_keys((new Class_Users)->getRawAttributes());
$this->_user_attributes = array_filter($this->_user_attributes,
fn($key) => in_array($key, $valid_params),
ARRAY_FILTER_USE_KEY);
return $this;
}
......
......@@ -87,6 +87,7 @@ abstract class IdentityProviderAuthenticationCas3BokehToBokehTestCase
return ['nom' => 'lastname',
'prenom' => 'firstname',
'mail' => 'mail',
'libelle_bib' => 'site_label',
'id_site' => 'site_code'];
}
......@@ -99,7 +100,7 @@ abstract class IdentityProviderAuthenticationCas3BokehToBokehTestCase
'prenom' => 'P.D.',
'password' => '1234',
'civilite' => "1",
'date_naissance' => '2022-12-08',
'naissance' => '2022-12-08',
'role_level' => ZendAfi_Acl_AdminControllerRoles::INVITE,
'id_site' => 1]);
}
......@@ -140,6 +141,7 @@ class IdentityProviderAuthenticationCas3WrongMappingTest
protected function _getMapping() {
return ['nom' => 'badlastname',
'libelle_bib' => 'site_label',
'prenom' => 'firstname'];
}
......@@ -160,6 +162,12 @@ class IdentityProviderAuthenticationCas3WrongMappingTest
public function userShouldBeRemotelyLoggedAsModoPortail() {
$this->assertEquals('modo_portail', Class_Users::getIdentity()->getNomRole());
}
/** @test */
public function userShouldNotHaveLibelleBibSet(){
$this->assertTrue(!array_key_exists('libelle_bib',Class_Users::getIdentity()->getRawAttributes()));
}
}
......@@ -378,7 +386,7 @@ class IdentityProviderAuthenticationCas3Bokeh2BokehWithAutoUpdateUsersTest
return ['nom' => 'lastname',
'prenom' => 'firstname',
'mail' => 'mail',
'date_naissance' => 'birth_date',
'naissance' => 'birth_date',
'idabon' => 'card_number',
'id_sigb' => 'ils_number',
'mail' => 'mail'];
......@@ -390,7 +398,7 @@ class IdentityProviderAuthenticationCas3Bokeh2BokehWithAutoUpdateUsersTest
['Id', '98134'],
['Nom', 'Pouce'],
['Prenom', 'Tom'],
['DateNaissance', '1978-08-02'],
['Naissance', '1978-08-02'],
['Idabon', '123XPE'],
['IdSigb', '22345'],
['Mail', 'tom@pouce.fr'],
......
......@@ -11,6 +11,7 @@
<cas:ils_number>22345</cas:ils_number>
<cas:birth_date>1978-08-02</cas:birth_date>
<cas:postal_code>38123</cas:postal_code>
<cas:site_label>NY Public Library</cas:site_label>
<cas:city>Laval</cas:city>
<cas:affiliation>supremes</cas:affiliation>
<cas:affiliation>temptations</cas:affiliation>
......
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