From 26ab7edfabe31a9ff77485b97637e29aa7c8d42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hellebrandt?= Date: Tue, 7 May 2024 16:53:27 +0200 Subject: [PATCH] Fix TOTP generation. Fix what commit a5a5cd9e5e broke. (#14645) (cherry picked from commit 50195ff3aa7d7055738b6cbf561d82f2f9da37d4) --- tests/foreman/destructive/test_ldap_authentication.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/foreman/destructive/test_ldap_authentication.py b/tests/foreman/destructive/test_ldap_authentication.py index 050ae241d0f..485fc620365 100644 --- a/tests/foreman/destructive/test_ldap_authentication.py +++ b/tests/foreman/destructive/test_ldap_authentication.py @@ -130,7 +130,7 @@ def configure_hammer_session(parametrized_enrolled_sat, enable=True): def generate_otp(secret): """Return the time_based_otp""" - time_otp = pyotp.TOTP(secret) + time_otp = pyotp.TOTP(secret, digest='SHA1', digits=6, interval=120) return time_otp.now() @@ -569,7 +569,9 @@ def test_user_permissions_rhsso_user_multiple_group( assert login_details['username'] in current_user -def test_totp_user_login(ad_data, module_target_sat): +def test_totp_user_login( + enable_external_auth_rhsso, rhsso_setting_setup, ad_data, module_target_sat +): """Verify the TOTP authentication of LDAP user interlinked with RH-SSO :id: cf8dfa00-4f48-11eb-b7d5-d46d6dd3b5b2