Production-grade authentication and authorization service built using Spring Boot and PostgreSQL.
This project focuses on implementing secure JWT authentication with clean architecture and enterprise-level backend practices.
- User Signup & Login
- JWT Authentication
- Spring Security Integration
- BCrypt Password Encryption
- Stateless Authentication
- Protected APIs
- Global Exception Handling
- Standard API Response Structure
- PostgreSQL Integration
- Layered Architecture
- Validation & Error Handling
- Java 21
- Spring Boot 3
- Spring Security
- PostgreSQL
- JPA / Hibernate
- JWT (Auth0 Java JWT)
- Maven
src/main/java/com/authservice
├── api
│ ├── controller
│ └── advice
│
├── application
│ ├── dto
│ └── service
│
├── infrastructure
│ ├── config
│ ├── entity
│ ├── repository
│ └── security
│
├── common
│ ├── exception
│ └── response
- User signs up
- User logs in with email/password
- JWT access token is generated
- Client sends JWT in Authorization header
- Spring Security validates token
- Protected APIs become accessible
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/signup |
Register user |
| POST | /api/v1/auth/login |
Login user |
{
"email": "user@example.com",
"password": "Password@123"
}{
"success": true,
"message": "Login successful",
"data": {
"accessToken": "jwt-token"
}
}{
"success": false,
"code": 4001,
"message": "Invalid username or password",
"path": "/api/v1/auth/login"
}git clone https://github.com/your-username/secure-auth-service.gitCreate database:
CREATE DATABASE secure_auth_service;spring:
datasource:
url: jdbc:postgresql://localhost:5432/secure_auth_service
username: postgres
password: postgresmvn spring-boot:run- Refresh Token Support
- Refresh Token Rotation
- Session Management
- Role-Based Access Control (RBAC)
- Redis Rate Limiting
- RS256 JWT Signing
- Docker Support
- Swagger/OpenAPI Documentation
This project is being built to practice and demonstrate:
- Secure authentication design
- Spring Security architecture
- JWT implementation
- Enterprise backend structure
- Clean API design
- Production-level exception handling
Gautam Tech Lead | Spring Boot | Distributed Systems | Cloud & Security