Skip to content

erudisiya/auth_twiliootp

Repository files navigation

Moodle OTP Authentication Plugin

Overview

This Moodle plugin provides an OTP (One-Time Password) authentication method via WhatsApp, utilizing Twilio API. It enables new users to create accounts on your LMS site through a secure OTP verification process sent via WhatsApp.

Features

  • WhatsApp OTP Verification: Users can verify their accounts using OTPs sent to their WhatsApp mobile numbers.
  • Twilio Integration: Leverages Twilio’s API for sending OTPs.
  • Secure Account Creation: Enhances security by requiring OTP verification for new account registrations.
  • OTP Resend Time Limit: Configurable time limit to prevent users from requesting an OTP too frequently.
  • OTP Expiry Time: Configurable time period for how long the OTP is valid.

Requirements

  • Moodle version: 3.9 or higher.
  • PHP version: 7.2 or higher
  • Twilio account with WhatsApp access.

Installation

1. Download the Plugin

Clone this repository to your Moodle auth directory:
https://github.com/erudisiya/auth_twiliootp

2. Configure Twilio

  • Twilio Account SID and Auth Token: You’ll need these credentials from your Twilio account.
  • Twilio Number: Set up your Twilio number for WhatsApp.

3. Plugin Configuration

  1. Log in to your Moodle site as an administrator.
  2. Navigate to Site administration > Plugins > Authentication > Manage authentication.
  3. Enable the "Twilio OTP Authentication" authentication method.
  4. Configure the plugin settings by providing your Twilio Account SSID, Auth Token, and Twilio Number.

Usage

1. Account Registration:

  • When a new user registers on your Moodle site, they will receive an OTP via WhatsApp.
  • The user must enter the OTP to complete their account creation process.

2. Troubleshooting:

  • Ensure Twilio credentials are correctly configured.
  • Check Twilio’s WhatsApp configuration to ensure your number is set up correctly.

Configuration Settings

  • Twilio Account SSID: Your Twilio Account SSID.
  • Twilio Auth Token: Your Twilio Auth Token.
  • Twilio Number: Your Twilio number is configured for WhatsApp.
  • OTP Expiry Time: The time (in minutes) until the OTP expires.
  • OTP Resend Time: The time (in seconds) until the OTP resend

More Documentation

More information with screenshots of this plugin can be found on the Twilio OTP.

License

Code is under the GNU GENERAL PUBLIC LICENSE v3.