Time-based OTP in offline Mobile App

🎯 Purpose

Provides offline authentication capability through Time-based One-Time Passwords (TOTP) generated by the REL-ID mobile application, following the OATH TOTP standard. This factor works without internet connectivity.


🔧 Technical Implementation

StandardSpecificationDetails
OATH TOTPRFC 6238 compliantIndustry standard time-based algorithm
Time Window30-second intervalsNew code generated every 30 seconds
Code Length6 digitsNumeric code for easy entry
AlgorithmSHA-1 basedStandard cryptographic hash function
SynchronizationTime-basedRelies on accurate device clock

📋 Prerequisites and Requirements

RequirementStatusDescription
REL-ID Mobile App✅ RequiredApp must be installed and properly activated
Device Clock⚠️ CriticalAccurate time synchronization essential
TOTP Seed✅ RequiredSecret key established during REL-ID enrollment
App Access✅ RequiredUser must be able to open and use mobile app

🔄 Authentication Process

  1. Code Generation: Mobile app automatically generates current 6-digit TOTP code
  2. Code Display: Current code shown prominently in mobile app interface
  3. Code Entry: User manually enters 6-digit code on web authentication portal
  4. Server Validation: Web portal validates code against expected value for current time window
  5. Time Window Check: Code must be used within current 30-second window
  6. Single Use Validation: Each code can only be used once successfully
  7. Authentication Result: Valid code allows authentication to proceed

📊 Offline Capabilities

FeatureSupport LevelDescription
No Internet Required✅ Full SupportWorks completely offline on mobile device
Battery Independent✅ Full SupportFunctions with minimal device power
Network Independent✅ Full SupportNo cellular or WiFi connection needed
Time Dependency⚠️ Critical RequirementRequires accurate device clock synchronization

🎯 Success and Failure Scenarios

✅ Success Scenarios

  • Valid Code: User enters correct 6-digit code within time window
  • Proper Timing: Code used within current 30-second interval
  • First Use: Code hasn't been previously used for authentication
  • Clock Synchronized: Device time matches server time within acceptable range

❌ Failure Scenarios

Error TypeCauseUser ExperienceResolution
Invalid CodeWrong digits entered"Invalid code" error messageUser can retry with same or new code
Expired CodeCode from previous time window"Code expired" errorUser must wait for new code generation
Already UsedCode previously used successfully"Code already used" errorUser must wait for next code
Clock DriftDevice time out of syncPersistent validation failuresDevice time synchronization needed
Rate LimitingToo many failed attemptsTemporary account lockoutWait for cooling period to end

Troubleshooting Guidance

  • Code Not Working: Wait for next 30-second interval and try new code
  • Persistent Failures: Check device date/time settings and sync with network
  • Clock Issues: Enable automatic time synchronization on mobile device
  • App Problems: Restart mobile app or check for app updates
  • Backup Option: Use REL-IDverify Push Notification if data connection available