Work
01 / Backend · Security

Centralized Authentication Service

Authentication infrastructure for multiple applications using JWT, JWKS, and RSA cryptography.


A centralized authentication service designed to issue and verify tokens across multiple independent applications. Eliminates duplicated authentication logic by providing a single source of truth for identity and access control.

When multiple applications independently implement authentication, the result is duplicated code, inconsistent security behavior, and difficult key management. Each service reinventing auth introduces risk and maintenance overhead.

Centralize token issuance and expose a JWKS endpoint so dependent services can verify tokens using the auth service's public key — without needing shared secrets. Services become stateless with respect to authentication.

AUTH SERVICE
    │
JWT / JWKS / RSA Keys
    │
┌───┴───────┬──────────┐
▼           ▼          ▼
OPD      PHARMACY     LAB
Service   Service    Service

RSA key pairs are used over HMAC secrets to allow token verification without sharing a private key. JWKS endpoint enables automatic key rotation without redeploying services.

Designing a clean interface for dependent services to verify tokens without coupling them to the auth service's internals. Ensuring graceful key rotation handling.

Node.jsTypeScriptJWTJWKSRSAExpress