Skip to content

Add Backend Support for Two-Factor Authentication (2FA) #2614

Open
@camillegonzales

Description

Is your feature request related to a problem? Please describe.
The CARE project currently lacks backend support for Two-Factor Authentication (2FA). Frontend work (Issue #6715) is in progress, but backend enhancements are essential for generating, verifying, and securely storing Time-Based One-Time Password (TOTP) tokens. Without backend support, 2FA cannot function, leaving accounts vulnerable to unauthorized access.

Describe the solution you'd like
Add backend functionality to complement frontend implementation:

  • Database Updates: Add fields for encrypted TOTP secrets and 2FA status.
  • API Endpoints:
    • Generate and verify TOTP tokens
    • Enable/disable 2FA
    • Provide backup codes for recovery
  • Security Measures:
    • Encrypt TOTP secrets
    • Implement rate limiting for token verification
  • Testing: Create unit and integration tests for all 2FA features

Describe alternatives you've considered

  • Relying only on frontend logic for 2FA is insecure
  • Using external 2FA services increases dependency on third-party tools and raises privacy concerns

Additional context
The frontend issue mentions integrating a library compatible with TOTP, such as pyotp.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status

    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions