Is there a semi-easy/plug-n-play way to have 2FA for login?

Is there a way to have 2FA (two-factor authentication) for logins?

There is an existing post with example

3 Likes

Turns out it’s not difficult at all to implement a basic 2FA. I’ve done it for our project, and if anyone’s interested I can share some code.

It doesn’t use anything external - not Google auth or anything. It just uses simple randomly-generated codes that are tied to the user that requested them and are only valid for a set length of time.

I chose not to play with the linked example as it’s in CUBA 6.5 and updating it would be less than fun. Plus being tied to external projects (the Google auth code) isn’t desirable for us.

Please note that the attached example does not use any Google services. It is based on simple time based codes and Google Authenticator used only as the example app for codes generation, you may use any 2FA app with time codes support.

1 Like