This topic is locked
[SOLVED]

Two factor authentication

12/4/2024 10:54:29 AM
PHPRunner General questions
G
George Kondylis author

Hello,

I’m experiencing an unusual issue with two-factor authentication (2FA). I’ve enabled 2FA using an authentication app. After signing in, I’m directed to the authenticator page to set up 2FA. I complete the steps and successfully activate it on my phone. However, when I log out and try to sign back in, I’m prompted to go through the 2FA setup process again. It works fine on other projects but I cant see what I am doing wrong here.

Any suggestions would be helpful

Thanks
George

M
MikeT 12/4/2024

Did you check in the user table if anything is written to the TOTP fields?
And: do you have any custom code running in the Login ebent hooks? (The latter can disturb the 2fa setup process).

G
George Kondylis author 12/4/2024

Hello Mike,

Yes, it does write to the TOTP fields. Every time it goes through the process it creates a new totp value. I had custom code on the After successfull login which was initially throwing errors during the 2FA. After clearing the custom code, I am experiencing the above issue

D
DRCR Dev 12/5/2024

Make sure that all views (INCLUDING USERINFO.PHP.) that access the user table, can read the entire table. I made that mistake in 10.6 when trying to limit access to such a cricical table, I reduced the number of fields in the query on an unrelated view and it breaks everything.

So every user table gets full database read and limit access through PHP. Since I stopped limiting the queries never had an issue again.

G
George Kondylis author 12/5/2024

DRCR Dev,

You were right! I just reset the query for the users table and it worked! I had added the 2FA at a later stage and the query wasn't including the two fields for the 2FA. Now it works !

thank you for your help

George