Best practices for sending and securing OTPs
- Short validity period: 3 to 10 minutes recommended, to limit the operating window in the event of interception
- Code length: 6 digits is the recommended standard (good security/user experience balance)
- Limit attempts: block or slow down after 3-5 failed verification attempts for the same code, to avoid brute force
- Limit the sending frequency: impose a minimum delay (e.g. 60 seconds) between two OTP requests for the same number, to avoid abuse and spam
- Use a recognized Sender ID/channel: a validated and consistent Sender ID reassures the user and reduces the risk of perceived phishing
- Provide a fallback: backup SMS if WhatsApp sending fails, to never block a legitimate user
All these rules (expiration, attempt limit, throttling) can be configured directly via the EnvoiSMS.ma OTP API settings, without additional logic to code on your side.