Project

General

Profile

Actions

User Story #541

open

Feature #533: Authentication Hum Rahi

EPIC #539: Epic: User Authentication - OTP Verification & Security

User Story HR-BE-01: OTP Validation API & Token Generation

Added by Islam Mansoori about 1 month ago. Updated about 1 month ago.

Status:
To Do
Priority:
low
Assignee:
-
Target version:
Start date:
Due date:
% Done:

87%

Estimated time:
(Total: 0:00 h)

Description

Role: Back-End User Story Story: As a System, I want to validate the 6-digit code against the stored value and initiate a session, so that I can confirm the user's identity and grant access.

  • In-Scope: * POST Endpoint /api/v1/auth/verify-otp.
    • Logic to compare submitted OTP with cached value.
    • Generation of JWT/Session token upon success.
  • Out-of-Scope: Handling lockout logic (covered in HR-BE-02).
  • Acceptance Criteria (AC):
    • AC1: Return 200 OK + Auth Token if OTP matches.
    • AC2: Return 401 Unauthorized if OTP is incorrect or expired.
    • AC3: Invalidate the OTP immediately after one successful use.
  • Validation Rules: Request must contain mobile_number and a string of 6 digits.
  • Error Messages: * Incorrect: "The code you entered is incorrect."
    • Expired: "This OTP has expired. Please request a new one."
  • Definition of Done (DoD): API documented in Swagger; Unit tests cover Match/Mismatch/Expiry; Security review of token signature.

Subtasks 8 (1 open7 closed)

Task #557: Create OTP Verification API EndpointBackend completedzaid ali

Actions
Task #558: Implement OTP Validation LogicBackend completedzaid ali

Actions
Task #559: Implement OTP Expiry HandlingBackend completedzaid ali

Actions
User Story #560: Invalidate OTP After Successful VerificationBackend completedzaid ali

Actions
User Story #561: Implement JWT Token Generation After Successful OTP VerificationBackend completedzaid ali

Actions
User Story #562: Persist Refresh Token in Redis for Session ManagementBackend completedzaid ali

Actions
User Story #563: Implement Error Handling for OTP Verification FailuresBackend completedzaid ali

Actions
Task #564: Document OTP Verification API in Swagger/OpenAPITo Dozaid ali

Actions
Actions #1

Updated by zaid ali about 1 month ago

  • Subtask #557 added
Actions #2

Updated by zaid ali about 1 month ago

  • Subtask #558 added
Actions #3

Updated by zaid ali about 1 month ago

  • Subtask #559 added
Actions #4

Updated by zaid ali about 1 month ago

  • Subtask #560 added
Actions #5

Updated by zaid ali about 1 month ago

  • Subtask #561 added
Actions #6

Updated by zaid ali about 1 month ago

  • Subtask #562 added
Actions #7

Updated by zaid ali about 1 month ago

  • Subtask #563 added
Actions #8

Updated by zaid ali about 1 month ago

  • Subtask #564 added
Actions

Also available in: Atom PDF