Skip to content

Commit

Permalink
Ajoute les scopes birthdate birthplace à la requête
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabinout committed May 30, 2024
1 parent 44bc931 commit 4caa79e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/creationSessionFCPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const creationSessionFCPlus = (config, requete, reponse) => {

return adaptateurFranceConnectPlus.urlCreationSession()
.then((url) => reponse.redirect(
`${url}?scope=profile%20openid&acr_values=eidas2&claims={%22id_token%22:{%22amr%22:{%22essential%22:true}}}&prompt=login%20consent&response_type=code&idp_hint=${adaptateurEnvironnement.fournisseurIdentiteSuggere()}&client_id=${identifiantClient}&redirect_uri=${urlRedirectionConnexion}&state=${etat}&nonce=${nonce}`,
`${url}?scope=profile%20openid+birthcountry+birthplace&acr_values=eidas2&claims={%22id_token%22:{%22amr%22:{%22essential%22:true}}}&prompt=login%20consent&response_type=code&idp_hint=${adaptateurEnvironnement.fournisseurIdentiteSuggere()}&client_id=${identifiantClient}&redirect_uri=${urlRedirectionConnexion}&state=${etat}&nonce=${nonce}`,
));
};

Expand Down
16 changes: 16 additions & 0 deletions test/api/creationSessionFCPlus.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ describe('Le requêteur de création de session FC+', () => {
return creationSessionFCPlus(config, requete, reponse);
});

it("ajoute les scopes d'openId, de profil, de pays de naissance et de lieu de naissance à la requête", () => {
expect.assertions(3);
reponse.redirect = (url) => {
try {
expect(url).toContain('scope=profile%20openid');
expect(url).toContain('birthcountry');
expect(url).toContain('birthplace');
return Promise.resolve();
} catch (e) {
return Promise.reject(e);
}
};

return creationSessionFCPlus(config, requete, reponse);
});

describe('Si utilisation bridge eIDAS', () => {
it('renseigne le paramètre `idp_hint` avec la valeur `eidas-bridge`', () => {
expect.assertions(1);
Expand Down

0 comments on commit 4caa79e

Please sign in to comment.