Admin Management Portal
Authorized staff directory. Create teachers and staff members, edit account statuses (which automatically revokes sessions when deactivated), and explicitly deregister existing devices with CSRF protection.
admin / Admin@123
Native Android Kotlin App
Production-grade implementation guide for the native Android client using Kotlin, Retrofit, Coroutines, and EncryptedSharedPreferences (Android Keystore) for hardware-anchored device ID storage with zero sensitive permissions.
Fast2SMS WhatsApp Gateway
Live integration with Fast2SMS WhatsApp Business API using message template 3529. Cryptographically secure 6-digit OTP delivery with one-way password hashing and 10-minute expiry.
🔌 Production REST API Endpoints Specification
/api/auth/request-otp.php
Rate-limited (max 3/day), generates cryptographically secure 6-digit OTP, hashes & sends via Fast2SMS WhatsApp.
/api/auth/verify-otp.php
Row lock transaction, verifies OTP, enforces single-device binding (Case A/B/C), returns 64-char raw session token.
/api/auth/logout.php
Revokes active session token. Device binding remains active permanently.
/api/auth/me.php
Validates Bearer token against SHA-256 hash, checks status = active, updates last_used_at.
🛡️ Security Architecture Enforcement
- Atomic Row Locking:
SELECT ... FOR UPDATEinside PDO database transactions prevents concurrent duplicate device bindings. - Secure Token Storage: Plaintext session tokens are never saved in MySQL; only
hash('sha256', $sessionToken)is stored. - One-Way OTP Hashes: OTPs are stored exclusively using
password_hash()withpassword_verify()and invalidated after 1 use or 5 wrong attempts. - Fast2SMS WhatsApp API: Credentials kept in environment configuration; API key and raw OTP codes are never exposed to client or server logs.
- Admin CSRF Defense: All admin state mutations (user creation, editing, device deregistration) require cryptographically randomized CSRF tokens.