Search for answers or browse our knowledge base.
Adding supplementary 2FA methods to WP 2FA
WP 2FA offers several 2FA authentication methods, which are available straight out of the box. These include:
- TOTP (one-time code via an app)
- Email HOTP (one-time code via email)
- Email link
- SMS (via third-party services)
- Push notifications (via a third-party service)
You’ll also find a selection of 2FA backup methods, helping you ensure users are not locked out should their primary 2FA authentication method become unavailable (such as their phone running out of battery).
However, you might want to add supplementary authentication methods that we do not currently support. In such scenarios, you can freely integrate a third-party service provider through the provided API.
How does it work?
The Melapress WP 2FA API provides several methods and hooks for integrating 2FA service providers not currently available in the plugin. You can add both primary and secondary (backup) 2FA methods, giving you complete freedom over which authentication methods you offer to your users.
Any methods you add will be listed alongside any ‘native methods’ you make available to your users, with hooks specifically available for this purpose. This ensures seamless integration with the plugin for maximal cohesion.
The API has been developed in such a way that it provides you with considerable flexibility over how any supplementary 2FA authentication methods are implemented. This ensures that different methods can easily be integrated.
All requirements and conventions you need to know are listed in the API technical documentation. Here you’ll also find sample implementations and all available hooks.
Navigating the documentation
The documentation, which you’ll find on our GitHub repository, is split into two parts. The first part details how to add a primary 2FA method, while the second part focuses on how to add secondary (backup) methods. Here, you can choose to implement a main method only, a backup method only, or both.
None of the hooks are mandatory by default – this will largely depend on the 2FA method you choose to add. Comments in the code snippets will help you determine whether you need a given hook or not.
When to add supplementary 2FA methods
While we endeavor to add as many 2FA authentication methods as possible and even add new ones from time to time, we also understand that our customers need flexibility. Whether you’re already using a specific 2FA authentication method in your organization that you would like to add to WordPress or simply want to offer your users more options, the API is there to enable you to do just that.
Adding such a service can be quite technical. As such, we recommend someone with experience in PHP and WordPress undertake any implementation since
Our support team is also ready to assist you with any questions you might have.
Open a ticket to get in touch with us.