• Resolved nickamis

    (@nickamis)


    We recently moved our website to Siteground and since doing so the 2FA login has not worked. We’ve tried disabled and re-enabling it but to no effect.

    The error we’re getting is:

    ERROR: An error was encountered while trying to authenticate. Please try again.

    Nothing has changed on the website. We just migrated it using Site Ground migrator. We are now using Cloudflare for DNS.

    Any ideas?

    Thanks, Nick

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @nickamis,

    If you’ve disabled and re-enabled 2FA I would expect that to solve any issues around potential time discrepancies between the old server and the new one. Sometimes I’ll also recommend having Wordfence > Login Security > Settings > Delete Login Security tables and data on deactivation checked when disabling 2FA to ensure none of the data from your old site can affect the authentication on the migrated version, so you could try that.

    On your login page when 2FA is enabled and login is attempted, do you see any errors in the browser console. You can screenshot any results using a service like Snipboard.

    Failing the above, please can you send a diagnostic report to wftest @ wordfence . com? You can find the link to do so at the top of the Wordfence > Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    NOTE: It should look as follows – Screenshot of Tools > Diagnostic > Send by Email

    Thanks,

    Peter.

    Thread Starter nickamis

    (@nickamis)

    I tried the setting ‘Delete login Security…’ when deactivating but it did not change anything.

    I have emailed a copy of the diagnostic log.

    I have the following console errors after attempting a login:

    [Error] Origin https://www.cpauk.net is not allowed by Access-Control-Allow-Origin.
    [Error] XMLHttpRequest cannot load https://cpauk.net/wp-admin/admin-ajax.php due to access control checks.
    [Error] Failed to load resource: Origin https://www.cpauk.net is not allowed by Access-Control-Allow-Origin. (admin-ajax.php, line 0)

    Thread Starter nickamis

    (@nickamis)

    I think I’ve fixed it.
    During migration I choose to drop www from the domain name. Now the website appears to be confused with a mix of non-www and www requests causing CORS problems.
    I updated the WordPress settings to re-add www and 2FA is now working.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @nickamis,

    That’s certainly good news, and one I have seen affect reCAPTCHA key validity before too. It makes sense as the access control errors you were getting contains a mixture of the www and non-www versions.

    If you have any further Wordfence questions in future, by all means start a new topic and we’ll be happy to help any time.

    Peter.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when 2FA enabled’ is closed to new replies.