This app showcases real-world Authentication and Authorization techniques with NestJS from access to refresh tokens, and everything in between:
- JWT-based authentication (refresh tokens, invalidating tokens)
- Role-based Access Control
- Claims-based Authorization
- Policy-based Authorization
- Integrate API Keys feature
- Implement server-side sessions
- Two-factor (2FA) authentication
- Google authentication
- Sessions with Passport
- Make sure you have docker installed on your local machine.
- Duplicate the
.env.example
file and rename it to.env
. Fill in the required variables.
# Install dependencies
$ npm install
# setup postgres database with docker
$ docker compose up
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Import the file NestAuth.postman_collection
in your Postman. It will add a new collection name Nest Auth
in your workspace.
Nest is MIT licensed.