This repository, provides a solution for integrating OTP (One-Time Password) functionality using Africa's Talking API. The project includes code to generate, send, and verify OTPs via SMS for authentication or verification processes. It is built using PHP, making it suitable for web applications requiring secure user v
MIT License
This project is a basic OTP (One-Time Password) sending and verification system, built with PHP, Bootstrap, and Composer. It utilizes the Africa's Talking API (Sandbox environment) to generate and send OTPs via SMS to users, ensuring secure authentication. The system includes both sending the OTP and verifying it for user login or account validation.
Clone the repository:
git clone https://github.com/Maithy-a/OTP-Request-VerificationSys.git
cd OTP-Africa-s-talking
Install dependencies with Composer:
composer require africastalking/africastalking
composer require vlucas/phpdotenv
Set up your Africa's Talking Sandbox API credentials in the .env
file:
AFRICASTALKING_USERNAME=sandbox
AFRICASTALKING_API_KEY=your_api_key_here
Create a .env
file at the root of the project and add the following environment variables:
AFRICASTALKING_USERNAME=sandbox
AFRICASTALKING_API_KEY=your_api_key_here
Obtain your OTP code via Africa's Talking Simulator: Since this project uses Africa's Talking Sandbox, the OTP will not be sent to your physical phone. Instead, follow these steps to use the simulator to retrieve the OTP:
+254
for Kenyan numbers) and click "Connect."Run the project on a local PHP server:
php -S localhost:8000
vlucas/phpdotenv
for environment variable management