From 2cd5e993c03893724e0e8248f2659b495548a271 Mon Sep 17 00:00:00 2001 From: Martin Lavoie Date: Mon, 28 Jun 2021 14:50:56 +0200 Subject: [PATCH] [caissedepargne] Add timestamp when requesting the config page The website started returning 403 without this parameter. Another possible solution was to change the User-Agent. Closes: 7081@sibi --- modules/caissedepargne/browser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index f4e31d42b8..d957f8fc61 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -151,7 +151,10 @@ class CaisseEpargneLogin(LoginBrowser, StatesMixin): new_login = URL(r'https://www.caisse-epargne.fr/se-connecter/sso', NewLoginPage) js_file = URL(r'https://www.caisse-epargne.fr/se-connecter/main-.*.js$', JsFilePage) - config_page = URL('https://www.caisse-epargne.fr/ria/pas/configuration/config.json', ConfigPage) + config_page = URL( + r'https://www.caisse-epargne.fr/ria/pas/configuration/config.json\?ts=(?P.*)', + ConfigPage + ) token_page = URL(r'https://www.as-ex-ano-groupe.caisse-epargne.fr/api/oauth/token', TokenPage) login_api = URL( r'https://www.rs-ex-ano-groupe.caisse-epargne.fr/bapi/user/v1/users/identificationRouting', @@ -810,7 +813,8 @@ def do_new_login(self, authentification_data=''): client_id = self.page.get_client_id() nonce = self.page.get_nonce() # Hardcoded in their js... if not self.continue_url: - self.config_page.go() + timestamp = int(time.time() * 1000) + self.config_page.go(timestamp=timestamp) self.continue_url = self.page.get_continue_url(self.cdetab, self.connection_type) # On the website, this sends back json because of the header -- GitLab