Support » Plugin: Two Factor Authentication » Cron Job being blocked by 2FA

  • Resolved vshura

    (@vshura)


    Hi all.

    I’m using CiviCRM plugin, which requires a cron job set up, which gets a https page with the username and password appended on to it. Specifically, the cron job executes the following

    php ~/www/www/wp-content/plugins/civicrm/civicrm/bin/cli.php -u username -p password -e Job -a execute

    When the 2FA plugin is switched off, it works perfectly. When it’s switched on, I get the following (I’ve made some redactions for security):

    Fatal error: Uncaught Error: Call to a member function get_option() on null in /***Path***/www/www/wp-content/plugins/two-factor-authentication/includes/class-simba-tfa.php:526
    Stack trace:
    #0 /***Path***/www/www/wp-content/plugins/two-factor-authentication/includes/class-simba-tfa.php(350): Simba_TFA->isActivatedForUser(‘5’)
    #1 /***Path***/www/www/wp-content/plugins/two-factor-authentication/two-factor-login.php(332): Simba_TFA->authUserFromLogin(Array, false)
    #2 /***Path***/www/www/wp-includes/class-wp-hook.php(286): Simba_Two_Factor_Authentication->tfaVerifyCodeAndUser(Object(WP_User), ‘***Username***’, ‘***Password***’)
    #3 /***Path***/www/www/wp-includes/plugin.php(208): WP_Hook->apply_filters(Object(WP_User), Array)
    #4 /***Path***/www/www/wp-includes/pluggable.php(539): apply_filters(‘authenticate’, NULL, ‘***Username***’, ‘***Password***’)
    #5 /***Path***/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(348): wp_authenticate(‘***Username***’, ‘***Password***’)
    # in /***Path***/www/www/wp-content/plugins/two-factor-authentication/includes/class-simba-tfa.php on line 526

    But 2FA is not a requirement of the WordPress user being invoked, nor it is a requirement for the role of that user.

    Can anyone advise?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Anderson

    (@davidanderson)

    This indicates that the script – /www/www/wp-content/plugins/civicrm/civicrm/bin/cli.php – is not setting up the WordPress environment correctly. However, we can work around that. Please try the just-released version 1.5.5.

    David

    Thread Starter vshura

    (@vshura)

    Great, thanks David. I updated and now it works perfectly.

    Many thanks,
    Sean.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cron Job being blocked by 2FA’ is closed to new replies.