Two Factor Authentication - Google Authenticator or Authy

Hey Ken, that would be great… but yes, php is my world…

Are you planning a PHP version soon?

Successfully integrated Firebase Authentication within a Wappler PHP project. Handles user registration, login and OAuth social logins. It updates the local security provider on confirmation via API. Took around 2 hours in total. Great for those that want a complete hands off solution for user login/registration, and the best part is that it’s included in the Firebase free plan.

Web Docs - https://firebase.google.com/docs/auth

Rest API Docs - https://firebase.google.com/docs/reference/rest/auth

(Google haters will hate.)

I’ll take a look early this week and let you know.

1 Like

I’m starting to feel a bit last century using PHP… :sweat_smile:

Thanks Ken! :slight_smile:

1 Like

Yep, I know that feeling! I didn’t realise NodeJS would overtake so quickly and take centre stage.

Not to worry, this morning I did a POC of the 2FA for PHP and will have it added to the course PDQ. :wink:

5 Likes

I’ve no idea what a POC is, but it sounds very positive and we love you Ken!

“Proof of concept”

Can somebody split this off of Antony’s feature request so as not to dilute? Even though I’m providing an option, his request for a feature still seems valid. :slight_smile:

@Antony @sitestreet I’ve added a php version of the custom authentication module that is referenced in the course, so just upload the php version instead of the .js. The hjson file remains constant as do the instructions on how to use (Although you’ll notice I added support for an Application identifier that shows up in the auth app).

In a nutshell in case you don’t want the full course, there are two actions that are utilized. The first simply generates a unique secret required by the authenticator app. Once a user has successfully provided a valid code, you save the secret on the user record and use it to verify any tokens for this user going forward.

The second action is the verify token. You pass a user provided token (from the auth app) along with the secret, and it returns a boolean true if it is valid.

The latest version of my extensions are here.

If interested in the library used for php, it is here.

2 Likes

Ken, you are SUCH a superstar, thank you soooo much! :slight_smile:

1 Like

Thanks @mebeingken. I’m gonna give this a go very soon.

And I’ll definitely be buying the course once it has PHP included :wink:

1 Like

The only things specific to node/php in the course are the modules. Today I uploaded the php version for the authentication, so I think you’ll be set!

Nice. Have just purchased :slight_smile:

1 Like

Hi folks,

Unfortunately it would appear that the courses that were available at the time are no longer available.

Is there somewhere I could learn more about implementing this two factor authentication extension that was released by @mebeingken? Or is there an alternative solution that I should be reading more about instead?

There is a custom module Ken created here:

And more details of how they are installed within Wappler (although it is pretty straightforward if the extension is already made):

Thanks @bpj,

I appreciate your reply. However I am familiar with installing custom modules to Wappler fortunately enough.

My main concern is how does this module in particular work. I have the standard username and password login setup from the Wappler Documentation, but I was wondering how I use this module properly in order to add the 2FA functionality to that.

The module has two actions:

One to generate a secret key (that you store against the user in the DB)

And another to validate the code produced in an authenticator app against that secret

The logic you use to apply the security provider functionality can vary quite heavily depending on whether all users require 2FA, whether you offer other methods other than Authenticator apps, whether you have existing users and existing Security Provider set up etc.

Here’s a link to those 2FA videos…obviously very old and potentially better ways to do things, but that’s progress for you!

https://drive.google.com/drive/folders/172tEoCYmSZnBEXWyoyLNdVYBd3TzXbVk?usp=share_link

1 Like