Actions
User Story #536
openFeature #533: Authentication Hum Rahi
EPIC #534: Epic: User Authentication - Mobile & OTP
User Story 2: Back-End - OTP Generation & WhatsApp Integration
Start date:
Due date:
% Done:
90%
Estimated time:
(Total: 0:00 h)
Reviewer:
Description
As a System, I want to receive a mobile number, generate a secure OTP, and trigger a WhatsApp message, so that the user's identity can be verified.
-
In-Scope:
- RESTful API endpoint (
/api/v1/auth/request-otp). - OTP generation logic (6-digit numeric).
- Integration with a WhatsApp Service Provider (e.g., Twilio, Meta Graph API).
- Rate limiting per mobile number.
- RESTful API endpoint (
-
Out-of-Scope:
- Verification of the OTP (handled in the next story/page).
- User profile creation (handled after successful verification).
-
Acceptance Criteria (AC):
-
AC1: Endpoint accepts
mobile_numberandremember_meboolean. - AC2: Generate a unique 6-digit OTP and store it in the cache (e.g., Redis) with a 5-minute expiry.
- AC3: Send the OTP via the configured WhatsApp API.
-
AC4: Return a
200 OKstatus upon successful handoff to the provider.
-
AC1: Endpoint accepts
-
Validation Rules:
- Rate Limit: Maximum 3 OTP requests per 10 minutes per IP/Number.
- Data Integrity: Ensure the number is stripped of whitespace before processing.
-
Error Messages:
- Too many requests: "Too many attempts. Please try again in 10 minutes."
- Provider Down: "Unable to send OTP at this moment. Please try again later."
-
Definition of Done (DoD):
- API endpoint documented in Swagger/OpenAPI.
- OTP successfully received on a test device via WhatsApp.
- Code reviewed and merged to the develop branch.
- Integration tests for the WhatsApp provider passed.
Updated by Islam Mansoori about 1 month ago
- Tracker changed from EPIC to User Story
- Description updated (diff)
Updated by Hamdan Iftikhar about 1 month ago
@zaid ali - Please make sure to add tasks for validation, especially rate limits, so it is not abused.
- Validation Rules:
- Rate Limit: Maximum 3 OTP requests per 10 minutes per IP/Number.
Actions