Sign inSign up

70madmax07/authapi-auth-service

By 70madmax07

•Updated 14 days ago

Production authentication microservice with Node.js, Express, JWT, and Redis token management.

Image
Security
Developer tools
0

124

70madmax07/authapi-auth-service repository overview

⁠Authentication Microservice API

A containerized, production-ready authentication and authorization microservice built with Node.js, Express, JSON Web Tokens (JWT), and Redis. Designed to handle user identity verification, session persistence, secure password hashing, and token invalidation.

⁠Architecture & Features

  • Token Lifecycle Management: Short-lived JWT access tokens paired with refresh tokens managed via Redis.
  • Fast Revocation & Blacklisting: Uses Redis in-memory storage for token invalidation on user logout, preventing reuse of compromised tokens.
  • Rate Limiting & Protection: Built-in protection against brute-force authentication attacks using Redis-backed rate limiting.
  • Stateless & Scalable: Ready to sit behind an API gateway or reverse proxy to authenticate microservices across distributed networks.

⁠Environment Variables

VariableRequiredDefaultDescription
PORTNo5000Port container listens on internally
NODE_ENVNoproductionRuntime mode (production / development)
JWT_SECRETYes—Secret key used to sign and verify access tokens
REFRESH_TOKEN_SECRETYes—Secret key used for refresh token signing
REDIS_HOSTYesredisHostname or IP of the Redis instance
REDIS_PORTNo6379Port for the Redis connection
MONGO_URI / DATABASE_URLYes—Primary database connection string for user credentials

⁠Quickstart (Standalone Container)

docker run -d \
  --name auth-service \
  -p 5000:5000 \
  -e PORT=5000 \
  -e NODE_ENV=production \
  -e JWT_SECRET="your_jwt_secret" \
  -e REDIS_HOST="auth_redis" \
  -e REDIS_PORT=6379 \
  70madmax07/authapi-auth-service:latest

Tag summary

Content type

Image

Digest

sha256:a6a107032…

Size

83 MB

Last updated

26 days ago

docker pull 70madmax07/authapi-auth-service