NestJS Auth Client for remote access token validation
npm install @tmdjr/ngx-auth-client🚀 Authentication & Authorization microservice built with NestJS, JWT, and MongoDB for Ngx Workshop microservices architecture.
- User Authentication: Secure user login and signup using JWT.
- Role-Based Access Control (RBAC): Fine‑grained authorization via NestJS guards and roles.
- Token Management: Generation and validation of access and refresh tokens.
- MongoDB Integration: Reliable storage for users, roles, and permissions.
- Modular & Scalable: Built for easy integration into microservice architectures.
- NestJS
- MongoDB & Mongoose
- JSON Web Tokens (JWT)
- Docker & Docker Compose
- GitHub Actions
- Docker & Docker Compose
- MongoDB instance
- Node.js (>=18)
- NestJS CLI
``bash`
git clone https://github.com/ngx-workshop/ngx-auth-service.git
cd ngx-auth-service
npm install
Create a .env file in the project root (see .env.sample for reference):
`bash`
npm run start:dev
`bash`
docker compose up -d
- POST /sign-up
Register a new user
- POST /sign-in
Authenticate existing user
- GET /sign-out
Logout the user
- GET /is-user-logged-in
Check user session status
- GET /user-metadata`
Retrieve user profile details
- JWT‑based authentication
- Environment variables stored securely via GitHub Secrets
- MongoDB secured by firewall rules and scoped permissions
Contributions are welcome! Please submit a PR or open an issue for bugs or suggestions.