Current Authentication Status
This open design prioritizes simplicity and ease of integration during development and testing phases. However, it comes with important security implications for production deployments.Open API Design
The current implementation allows unrestricted access to all endpoints:Benefits of Open Access
Rapid Integration
Start using the API immediately without authentication setup or key management.
Simplified Testing
Test endpoints freely during development without token rotation or authentication flows.
Low Barrier to Entry
Minimal configuration required for proof-of-concept implementations.
No Key Management
Avoid the complexity of storing, rotating, or securing API keys.
Security Considerations
Current Protection Mechanisms
While authentication is absent, the API includes basic protection:Rate Limiting (IP-Based)
The API implements rate limiting based on client IP addresses:- Rate: 5 requests per second per IP
- Burst: Up to 10 requests in a burst
- Scope: Applied to all endpoints (including
/compare,/stats, and/health) - Response: HTTP 429 (Too Many Requests) when exceeded
Rate limiting provides basic abuse prevention but is not a substitute for proper authentication in production environments.
CORS Configuration
The API allows cross-origin requests from any origin:Production Recommendations
Recommended Authentication Methods
For production deployments, implement one of these authentication strategies:API Key Authentication
API Key Authentication
Best for: Service-to-service communication, internal tools
- Generate unique API keys for each client
- Validate keys in middleware before request processing
- Include keys in
Authorizationor custom headers - Implement key rotation policies
OAuth 2.0 / JWT
OAuth 2.0 / JWT
Best for: User-facing applications, third-party integrations
- Implement JWT token validation
- Support standard OAuth 2.0 flows
- Enable fine-grained permissions and scopes
- Integrate with identity providers (Auth0, Keycloak, etc.)
mTLS (Mutual TLS)
mTLS (Mutual TLS)
Best for: High-security environments, zero-trust architectures
- Require client certificates for all connections
- Validate certificates at the TLS layer
- Strongest security but more complex setup
- Ideal for microservice mesh deployments
Reverse Proxy Authentication
Reverse Proxy Authentication
Best for: Existing infrastructure with auth layers
- Deploy API behind nginx, Caddy, or similar
- Implement authentication at proxy layer
- Forward authenticated requests to Iris API
- Leverage existing auth infrastructure
Additional Security Measures
Beyond authentication, consider these hardening steps:Enable HTTPS
Use TLS certificates to encrypt all API traffic. Never transmit face data over unencrypted connections.
Network-Level Access Control
If implementing application-level authentication is not immediately feasible, use network-level controls:Firewall Rules
VPN/Private Network
- Deploy API within a VPN
- Require VPN connection for access
- Use cloud provider’s private networking (AWS VPC, Azure VNet)
Container Network Policies
Migration Path
When adding authentication to an existing deployment:Frequently Asked Questions
Why doesn't the API include authentication by default?
Why doesn't the API include authentication by default?
The API is designed as a lightweight, easy-to-deploy face recognition engine. Authentication adds complexity and varies significantly based on deployment context (microservices, standalone apps, etc.). This design allows developers to choose the authentication strategy that best fits their architecture.
Can I use the API in production without authentication?
Can I use the API in production without authentication?
Only if deployed in a trusted, isolated network with strict access controls. For internet-facing or multi-tenant deployments, authentication is essential.
Does rate limiting protect against abuse?
Does rate limiting protect against abuse?
Rate limiting provides basic protection but is insufficient for production. Attackers can rotate IPs or use distributed systems to bypass IP-based rate limits.
What happens if I don't add authentication?
What happens if I don't add authentication?
Your API is vulnerable to:
- Unauthorized usage and resource consumption
- Data exfiltration through the comparison endpoint
- Denial of service attacks
- Compliance violations (GDPR, CCPA, etc.)
- Potential legal liability
Next Steps
Error Handling
Learn about error responses and troubleshooting
Integration Examples
See complete authentication implementation examples