A lightweight and ready-to-use user authentication service built with Jakarta EE 10. Designed as a starter template for future projects requiring JWT-based authentication and role-based authorization.
- User Authentication – Secure login with JWT token generation
- Role-Based Access Control – Restrict access using
ADMINandUSERroles - Security Filters – Implements authentication & authorization filters
- Database Integration – Uses MySQL with Hibernate JPA
- Configuration Management – Loads settings from
config.properties - Logging – Log4j for structured application logging
- Jakarta EE 10 (JAX-RS, CDI, JPA)
- JWT Authentication (Custom security filters)
- MySQL & Hibernate ORM
- Log4j for logging
- Bcrypt for password hashing
- Open Liberty as the application server
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /auth/register |
Register a new user | No |
| POST | /auth/login |
Authenticate & return JWT | No |
| GET | /users |
Get All users | Yes (Admin) |
| GET | /users/{id} |
Get user by ID | Yes (Admin) |
| DELETE | /users/{id} |
Delete user | Yes (Admin) |