A production-ready authentication system built using Spring Boot, Spring Security, JWT, and MySQL.
- User Registration & Login
- JWT-based Authentication
- Stateless Security
- Role-based Authorization (USER / ADMIN)
- BCrypt Password Encryption
- MySQL Database Integration
- Protected APIs using JWT filter
- Java 17
- Spring Boot
- Spring Security
- JWT (JSON Web Token)
- Spring Data JPA (Hibernate)
- MySQL
- Maven
- POST /api/auth/register
- POST /api/auth/login
- GET /api/users
- GET /api/admin (ADMIN role only)
- User logs in with email & password
- Server validates credentials
- JWT token is generated
- Token must be sent in Authorization header: Authorization: Bearer <JWT_TOKEN>
- JWT filter validates token on every request
- users
- roles
- user_roles
Built to demonstrate real-world Spring Security + JWT authentication and prepare for backend interviews.
Author: Shivam Yogi