Joomla: The two factor authentication Secret Key is invalid.

by Vince
in Blog
Hits: 1186

For whatever reason, 2fa stops working correctly and you're faced with "The two factor authentication Secret Key is invalid."

mysql -u root -p
show databases;

Of the databases, you'll have to know which is your database.  Let's call it "joomla" for the sake of this post.

use joomla;
show tables;

The prefix on the tables will be unique.  Let's call the extension "jom", again, for the sake of this post.  I can jump straight to the update statement but I want to make sure we're looking at the same thing.

describe jom_extensions;

This should produce the column names for the extensions table.  We should see a "name" field.

select name, enabled from jom_extensions where name = 'plg_twofactorauth_totp';

You should see the name and under the enabled column, you should see "1".

The following statement will disable 2fa:

update jom_extensions set enabled = '0' where name = 'plg_twofactorauth_totp';

If you previously attempted to login and you're making this change soon after, you should be able to just hit refresh and you'll be automatically logged in.  If not, go to the login page and you should see just the two lines for uid and pass.