Skip to content

Feat: Implement JWT authentication and Spring Security (Closes #32) - #42

Merged
Mbasa6 merged 1 commit into
Mbasa6:mainfrom
Ngandana:feature/jwt-authentication
Jun 8, 2026
Merged

Feat: Implement JWT authentication and Spring Security (Closes #32)#42
Mbasa6 merged 1 commit into
Mbasa6:mainfrom
Ngandana:feature/jwt-authentication

Conversation

@Ngandana

@Ngandana Ngandana commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR implements JWT authentication for the API endpoints to enhance security, as requested.

Changes Made

  • Added spring-boot-starter-security and jjwt-gson dependencies.
  • Created JwtUtil, JwtAuthenticationFilter, and SecurityConfig for stateless token generation and validation.
  • Updated UserService to generate actual JWTs upon successful login.
  • Created AuthController exposing the /api/auth/login endpoint.
  • Disabled security filters in ApiIntegrationTest so existing tests continue to run smoothly.

Testing

  • Ran mvn clean test. All 28 unit and integration tests pass successfully.

Closes #32

@Mbasa6
Mbasa6 self-requested a review June 8, 2026 02:23
@Mbasa6
Mbasa6 merged commit 9d3521c into Mbasa6:main Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add JWT authentication to API endpoints

2 participants