Download the PHP package fragotesac/zf1-2fa without Composer
On this page you can find all versions of the php package fragotesac/zf1-2fa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fragotesac/zf1-2fa
More information about fragotesac/zf1-2fa
Files in fragotesac/zf1-2fa
Package zf1-2fa
Short Description Zend Framework 1 2FA component
License BSD-3-Clause
Homepage http://framework.zend.com/
Informations about the package zf1-2fa
Zend Framework 1 Two-Factor Authentication (2FA) Library
This PHP library provides two-factor authentication (2FA) functionality for Zend Framework 1 applications. It allows for secure user login by requiring an additional step of verification, enhancing application security.
How to Use
Backend Configuration
-
Create an Action:
Implement an action in your backend where 2FA will be handled. -
Instantiate the 2FA Service:
-
Set Mail Configuration:
-
Initialize the 2FA Service: Call the init method with a callback function to validate the user:
- Implement the checkUser Method:
This method should handle user validation and error management using
Zend\Util\ResponseUtil.
Client-Side Setup
-
Copy the Client Folder:
Copy the2fa-clientfolder located insidesrcand place it in yourpublic/js/directory. - Initialize the 2FA Client:
Use the following JavaScript code to initialize the 2FA client:
apiUrl: The API endpoint previously created for 2FA.data: The login form fields converted into an object, e.g., {username: 'joe', password: 123456}.glass-theme: The style theme for the 2FA modal. Available themes are:glass-themecds-themeCallback Function: Handles the login URL and sanitized parameters.
Requirements
- Zend Framework 1
- PHP 8.0 or higher
- Composer for dependency management