From 26bea85a6b9a1c9eee536433e6f9af8b504265ac Mon Sep 17 00:00:00 2001 From: Damien Mat Date: Mon, 8 Feb 2021 10:19:30 +0100 Subject: [PATCH] =?UTF-8?q?[bp]=C2=A0Handle=20new=202FA=20message=20to=20t?= =?UTF-8?q?rigger=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous commit revealed new 2FA messages. that where silenced by an ActionNeed. Here it is a Certicode auth method that actually needed to be triggered. --- modules/bp/pages/login.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/bp/pages/login.py b/modules/bp/pages/login.py index 92e3c1cd21..2ffb136b80 100644 --- a/modules/bp/pages/login.py +++ b/modules/bp/pages/login.py @@ -163,7 +163,11 @@ def get_auth_method(self): status_message = CleanText('//div[@class="textFCK"]')(self.doc) if 'Une authentification forte via Certicode Plus vous' in status_message: return 'cer+' - elif 'authentification forte via Certicode vous' in status_message: + elif re.search( + 'authentification forte via Certicode vous' + + '|code de sécurité que vous recevrez par SMS', + status_message + ): return 'cer' elif re.search( 'avez pas de solution d’authentification forte' @@ -189,7 +193,7 @@ def get_auth_method(self): ) else: # raise an error to avoid silencing other no2fa cases - raise AssertionError('no2fa wrongly not skipped') + raise AssertionError("No 2FA case to skip, or new 2FA case to trigger") raise AssertionError('Unhandled login message: "%s"' % status_message) def get_skip_url(self): -- GitLab