From e22dd9bf30c1576a128ed85036cf977811bdf848 Mon Sep 17 00:00:00 2001 From: Augustin Bouverot Date: Tue, 9 Jun 2020 15:50:11 +0200 Subject: [PATCH] [caissedepargne] Fetch snid from another place In creditcooperatif (a caissedepargne child), the snid authentication parameter was not available in the parsed url. We can now take it from another place if it is not on the parsed url (it is always in the continue_parameters OR the url). --- modules/caissedepargne/browser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index 37d24a0556..ccd5d7ec24 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -677,6 +677,10 @@ def do_new_login(self, data): continue_url = url_params['continue'][0] continue_parameters = data['continueParameters'] + # snid is either present in continue_parameters (creditcooperatif / banquebcp) + # or in url_params (caissedepargne / other children) + snid = json.loads(continue_parameters).get('snid') or url_params['snid'][0] + self.location( url, method='POST', @@ -706,7 +710,7 @@ def do_new_login(self, data): 'display': 'page', 'client_id': client_id, 'claims': '{"userinfo":{"cdetab":null,"authMethod":null,"authLevel":null},"id_token":{"auth_time":{"essential":true},"last_login":null}}', - 'bpcesta': '{"csid":"%s","typ_app":"rest","enseigne":"ce","typ_sp":"out-band","typ_act":"auth","snid":"%s","cdetab":"%s","typ_srv":"part"}' % (csid, url_params['snid'][0], url_params['cdetab'][0]), + 'bpcesta': '{"csid":"%s","typ_app":"rest","enseigne":"ce","typ_sp":"out-band","typ_act":"auth","snid":"%s","cdetab":"%s","typ_srv":"part"}' % (csid, snid, url_params['cdetab'][0]), }, ) self.page.send_form() -- GitLab