[boobank][creditmutuel] Mobile confirmation is not working (1.6)
The creditmutuel otp page changed since #317 (closed) , and now when confirming connection on the phone it doesn't work.
I have at least 3 or 4 notifications one after the other from my phone to accept the connection and at the end I get "MobileConfirmation has no iter_accounts" error (possibly related to #337 (closed)), and no access to my account.
I found and fixed the issue this way, (but I cannot do a PR since gitlab/weboob/weboob is "503 currently unavailable" so I cannot fork) :
diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py
index d609a95fa..774fdd8d4 100644
--- a/modules/creditmutuel/pages.py
+++ b/modules/creditmutuel/pages.py
@@ -146,16 +146,20 @@ class MobileConfirmationPage(LoggedPage, HTMLPage):
if otp_hidden is None:
raise Exception('missing otp_hidden in Credit Mutuel OTP')
+ otp_post_url = CleanText('//form[@id="C:P:F"]/@action')(self.doc)
+ if otp_post_url is None:
+ raise Exception('missing anti forgery url in Credit Mutuel OTP')
+
num_attempts = 0
while num_attempts < self.MAX_WAIT:
time.sleep(1)
num_attempts += 1
response = self.browser.open(validation_status_url, method='POST', data={"transactionId":transaction_id})
if response.status_code == 200:
if 'PENDING' not in response.text:
response = self.browser.open(
- '?_tabi=C&_pid=OtpValidationPage',
+ otp_post_url,
method='POST',
data={
"otp_hidden": otp_hidden,
The key is to use the "AntiForgeryKey" in the action url, that we can readf from the form in the otp page.