Skip to content

Feature/auth login#2

Merged
pvdev1805 merged 8 commits intofeature/authfrom
feature/auth-login
Oct 26, 2025
Merged

Feature/auth login#2
pvdev1805 merged 8 commits intofeature/authfrom
feature/auth-login

Conversation

@pvdev1805
Copy link
Collaborator

This pull request introduces a comprehensive authentication and authorization system using JWT and Spring Security, along with improvements to user management and error handling. Key additions include new dependencies for security, configuration classes for JWT and security, controller endpoints for authentication and user info, and enhanced validation and error codes.

Authentication & Security Setup:

  • Added Spring Security, OAuth2 Resource Server, JWT, and password encryption dependencies to pom.xml to enable secure authentication and token management.
  • Implemented SecurityConfig and JwtTokenConfig classes to configure stateless JWT authentication, public endpoints, password encoding, and key rotation for tokens. [1] [2]
  • Created CustomBearerTokenAuthenticationEntryPoint for standardized authentication error responses.
  • Defined SecurityConstants for managing public authentication endpoints.

Authentication & User Endpoints:

  • Updated AuthenticationController to support user registration, login, and token refresh endpoints, using new request DTOs for validation and separating user creation from authentication logic. [1] [2] [3]
  • Added UserController with an endpoint to retrieve the currently authenticated user's details.

DTO & Validation Improvements:

  • Introduced LoginRequest and RefreshTokenRequest DTOs with validation annotations for authentication flows. [1] [2]
  • Enhanced UserCreationRequest and UserResponse DTOs for better security and clarity, including exclusion of sensitive fields from toString and explicit timestamp handling. [1] [2]
  • Updated AuthenticationResponse to include both access and refresh tokens.

Error Handling:

  • Expanded ErrorCode enum to cover authentication, token, and user-related errors for consistent API error responses.

Mapping Logic:

  • Refined UserMapper to ignore sensitive and system-generated fields during user creation mapping, ensuring proper initialization and security.

@pvdev1805 pvdev1805 merged commit 0eb2ce7 into feature/auth Oct 26, 2025
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.

1 participant