Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a dev, I want to migrate backend authentication from Basic Auth to JWT #163

Open
Tracked by #279
k-allagbe opened this issue Oct 6, 2024 · 0 comments
Open
Tracked by #279

Comments

@k-allagbe
Copy link
Member

k-allagbe commented Oct 6, 2024

Description

Context
The backend currently uses Basic Auth for authentication, which is outdated and doesn't meet modern standards. We need to replace Basic Auth with JWT (JSON Web Tokens) to provide a more appropriate and standardized authentication system for our REST API.

Problem Statement
Basic Auth is no longer suitable for handling user authentication in a REST-based system. We want to transition to JWT to ensure a more modern and secure method for managing user sessions and authentication. This migration should fully replace Basic Auth with JWT.

Acceptance Criteria

  • Modify the existing login endpoint to issue JWTs instead of relying on Basic Auth headers.
  • Implement middleware to validate JWTs for all protected API routes.
  • Ensure that protected routes require a valid JWT in the Authorization header (Bearer token).
  • Implement token expiration handling, ensuring that expired tokens return a 401 Unauthorized response.
  • Add support for token refreshing, allowing users to request a new token without needing to log in again.
  • Remove Basic Auth from all existing routes and replace it with JWT-based authentication.
  • Ensure that error handling for invalid or missing JWTs returns appropriate HTTP responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant