Skip to content

LibraryBookingSystem/auth-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auth-service

Registration, login, and JWT issuance for the Library Booking System. Persists no credentials locally; user records and password checks are delegated to user-service.

Role in the system

flowchart LR
  Client --> GW[api-gateway]
  GW --> AUTH[auth-service]
  AUTH --> USER[user-service]
  AUTH --> JWT[JWT to client]
Loading
Concern Owner
User storage user-service
Password validation user-service (internal API)
Token signing auth-service (JWT_SECRET, JWT_EXPIRATION)

API (via gateway)

Base path: http://localhost:8080/api/auth

Method Path Description
POST /register Create account (may require faculty/admin approval before login)
POST /login Authenticate and receive JWT
GET /validate Validate a bearer token
GET /health Service health

See API_REFERENCE.md for request and response shapes.

Stack

  • Java 17, Spring Boot 3.5
  • Spring Security, Validation, AOP
  • JJWT
  • common-aspects for shared security primitives

Configuration

Variable Default Purpose
USER_SERVICE_URL http://localhost:3001 user-service base URL
JWT_SECRET dev default in application.yaml HMAC signing key
JWT_EXPIRATION 3600000 Token lifetime (ms)

HTTP port 3002 (server.port).

Run locally

With Docker Compose (recommended):

cd docker-compose
docker compose up -d auth-service

Standalone: start user-service and its database first, then:

mvn spring-boot:run

Build the shared library first if you are not using the vendored JAR in the service libs/ folder:

cd common-aspects
mvn install

Related repositories

About

RBAC and JWT token generation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors