Status: ✅ Phase 3 Complete (Core Complete, Not Production Ready)
Base URL: http://localhost:8080 (Dev) | https://api.2fair.app (Prod)
All protected endpoints require JWT token:
Authorization: Bearer <jwt_token>
Returns implementation status and features.
Response:
{
"status": "Phase 3 Complete - Core Complete, Not Production Ready",
"version": "1.0.0",
"features": {
"oauth_authentication": true,
"webauthn_prf": true,
"zero_knowledge_encryption": true,
"clean_architecture": true
}
}List available OAuth providers.
Initiate Google OAuth flow.
Handle OAuth callback and create session.
Get authenticated user profile.
- Headers:
Authorization: Bearer <token>
Refresh JWT token.
- Headers:
Authorization: Bearer <token>
Invalidate user session.
- Headers:
Authorization: Bearer <token>
Start WebAuthn credential registration with PRF support.
- Headers:
Authorization: Bearer <token>
Response includes PRF extension:
{
"publicKey": {
"extensions": { "prf": {} },
"challenge": "base64_challenge",
// ... standard WebAuthn options
}
}Complete WebAuthn registration and extract PRF output.
- Headers:
Authorization: Bearer <token>
Request Body:
{
"id": "credential_id",
"response": { /* WebAuthn response */ },
"clientExtensionResults": {
"prf": { "results": { "first": "base64_prf_output" } }
}
}List user's encrypted TOTP data.
- Headers:
Authorization: Bearer <token>
Response:
{
"otps": [
{
"id": "uuid",
"service_name": "Google",
"account_identifier": "user@example.com",
"encrypted_secret": "base64_encrypted_data",
"algorithm": "SHA1",
"digits": 6,
"period": 30
}
]
}Create new encrypted TOTP entry.
- Headers:
Authorization: Bearer <token>
Request:
{
"service_name": "GitHub",
"account_identifier": "username",
"encrypted_secret": "base64_encrypted_secret",
"algorithm": "SHA1",
"digits": 6,
"period": 30
}Basic health check.
Response:
{
"status": "healthy",
"timestamp": "2025-01-28T14:30:00Z"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"timestamp": "2025-01-28T14:30:00Z"
}
}- Zero-Knowledge: Server never sees plaintext TOTP secrets
- Client-side encryption: AES-256-GCM with WebAuthn PRF key derivation
- Encrypted format:
base64(ciphertext || iv || authTag) - PRF fallback: Uses credential.id + PBKDF2 when PRF unavailable
Next Phase: Multi-Device Sync & Production Hardening