This is a simple RESTful application for testing new technologies and new ways of working!
Production-ready REST API built with Spring Boot implementing a complete JWT-based authentication and authorization system, including:
@ControllerAdvice)SecurityFilterChain ConfigurationUser ā UserDetails Mapping| Token | Lifetime | Purpose | | ------------- | ------------- | -------------------------- | | Access Token | 10ā15 minutes | Access protected endpoints | | Refresh Token | 7ā30 days | Generate new access tokens |
POST /api/auth/login
Response:
{
"accessToken": "...",
"refreshToken": "..."
}
POST /api/auth/refresh
Request Body:
{
"refreshToken": "..."
}
Response:
{
"accessToken": "new-access-token"
}
Service responsible for:
Utility class that converts the User entity into a UserDetails instance:
public class UserDetailsFactory {
public static UserDetails create(User user) {
List<GrantedAuthority> authorities = user.getRoles().stream()
.map(role -> new SimpleGrantedAuthority(role.getName()))
.toList();
return new org.springframework.security.core.userdetails.User(
user.getUsername(),
user.getPassword(),
user.isEnabled(),
true,
true,
true,
authorities
);
}
}
GrantedAuthorityclaims inside JWT.hasAuthority("ADMIN")
The project uses:
application.propertiesImplemented using @ControllerAdvice for:
UserDetails mappingāļø Production-ready āļø Complete security layer āļø Clean architecture āļø Ready for deployment
Developed as part of an advanced backend learning process using Spring Boot.
š„ This project follows real-world backend security standards and practices.