User Story: User Login with JWT Authentication #5

Closed
opened 2026-04-06 19:54:37 +02:00 by arcodange · 1 comment
Owner

As a registered user
I want to login with my username and password
So that I can access my personalized account and continue my dance journey

Acceptance Criteria

  • User can login with valid credentials
  • Invalid credentials return 401 Unauthorized
  • Successful login returns JWT token
  • JWT token expires in 30 minutes (configurable)
  • Token contains user ID, username, and admin flag
  • Login updates last_login timestamp

Technical Implementation

  1. Create BDD test scenario in features/user-login.feature
  2. Implement UserService.Login() method
  3. Implement JWT token generation and validation
  4. Create authentication middleware
  5. Add POST /api/v1/auth/login endpoint
  6. Update greet service to use authenticated username
  7. Update OpenAPI documentation

Implementation Steps

  1. Create BDD test (failing)
  2. Implement login service
  3. Add JWT utilities
  4. Create auth middleware
  5. Integrate with greet service
  6. Write unit tests
  7. BDD test passes
  8. Add OpenAPI documentation
  9. CI/CD validation
  10. Product Owner review
  • Part of Epic: #3 (User Management & Authentication System)
**As a** registered user **I want to** login with my username and password **So that** I can access my personalized account and continue my dance journey ### Acceptance Criteria - User can login with valid credentials - Invalid credentials return 401 Unauthorized - Successful login returns JWT token - JWT token expires in 30 minutes (configurable) - Token contains user ID, username, and admin flag - Login updates last_login timestamp ### Technical Implementation 1. Create BDD test scenario in features/user-login.feature 2. Implement UserService.Login() method 3. Implement JWT token generation and validation 4. Create authentication middleware 5. Add POST /api/v1/auth/login endpoint 6. Update greet service to use authenticated username 7. Update OpenAPI documentation ### Implementation Steps 1. Create BDD test (failing) 2. Implement login service 3. Add JWT utilities 4. Create auth middleware 5. Integrate with greet service 6. Write unit tests 7. BDD test passes 8. Add OpenAPI documentation 9. CI/CD validation 10. Product Owner review ### Related - Part of Epic: #3 (User Management & Authentication System)
Author
Owner

This issue has been implemented in the user authentication BDD system merge. Closing as completed.

This issue has been implemented in the user authentication BDD system merge. Closing as completed.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange/dance-lessons-coach#5