Secure Two-Factor Authentication Setup Guide
Set up SMS-based two-factor authentication in your application to protect user accounts effectively.
Start IntegrationWhy Use SMS for 2FA?
SMS-based two-factor authentication provides an additional layer of security by verifying user identity through mobile networks and unique one-time passcodes sent to verified numbers.
- Zero infrastructure to manage
- Industry-standard 6-digit codes
- 100% encrypted transit
Implementation Steps
Follow these steps to integrate 2FA into your application using our SMS API.
Send Verification Code
curl -X POST "https://api.egkkikikifistis.gr/v2/2fa/initiate" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"phone":"+16175550123","user":"123456"}'
Response:
{ "requestId": "REQ-890293", "expiresIn": 300 }
Validate User Code
curl -X POST "https://api.egkkikifistis.gr/v2/2fa/validate" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"code":"012345","requestId":"REQ-890293"}'
Success Response:
{ "valid": true, "user": "123456" }
Implementation Samples
Python Integration
import requests API_KEY = "your_api_key" def send_2fa_code(phone): return requests.post("https://api.egkkikikifistis.gr/v2/2fa/initiate", headers={"Authorization": f"Bearer {API_KEY}"})
Node.js Example
async function validateCode(requestId, userCode) { const response = await fetch("https://api.egkkikifistis.gr/v2/2fa/validate", { method: "POST", headers: { "Authorization": `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ requestId, code: userCode }) }); return await response.json(); }
Security Best Practices
Rate Limiting
Enforce 3 delivery attempts per minute per number
Session Binding
Link code to user IP and browser fingerprints
Timeout Enforcement
Auto-expire codes after 5 minutes
Case Study: Banking Platform
We secured login flows for a 120,000+ user financial application. Key results include:
Implement enterprise-grade 2FA with 100% carrier encryption and real-time delivery status tracking. We handle all code expiration, retries and fraud detection for you.