diff --git a/src/modeles/sessionFCPlus.js b/src/modeles/sessionFCPlus.js index ea20fdd..31908c5 100644 --- a/src/modeles/sessionFCPlus.js +++ b/src/modeles/sessionFCPlus.js @@ -25,8 +25,9 @@ class SessionFCPlus { ]) .then(([jwt, url]) => this.adaptateurChiffrement.verifieSignatureJWTDepuisJWKS(jwt, url)) .then((infosDechiffrees) => ({ - prenom: infosDechiffrees.given_name, + dateNaissance: infosDechiffrees.birthdate, nomUsage: infosDechiffrees.family_name, + prenom: infosDechiffrees.given_name, nonce: this.nonce, })) .catch((e) => Promise.reject(new ErreurEchecAuthentification(e.message))); diff --git a/test/modeles/sessionFCPlus.spec.js b/test/modeles/sessionFCPlus.spec.js index b61f6ad..109a63f 100644 --- a/test/modeles/sessionFCPlus.spec.js +++ b/test/modeles/sessionFCPlus.spec.js @@ -88,7 +88,7 @@ describe('Une session FranceConnect+', () => { try { expect(jwt).toBe('aaa'); expect(url).toBe('http://example.com'); - return Promise.resolve({ given_name: 'Anne', family_name: 'Durand' }); + return Promise.resolve({ given_name: 'Anne', family_name: 'Durand', birthdate: '1972-11-25' }); } catch (e) { return Promise.reject(e); } @@ -99,6 +99,7 @@ describe('Une session FranceConnect+', () => { .then((json) => { expect(json).toHaveProperty('prenom', 'Anne'); expect(json).toHaveProperty('nomUsage', 'Durand'); + expect(json).toHaveProperty('dateNaissance', '1972-11-25'); }); });