{"id":13764483,"url":"https://github.com/jajaperson/nestjs-auth0","last_synced_at":"2025-06-17T13:32:53.498Z","repository":{"id":40751095,"uuid":"169219043","full_name":"jajaperson/nestjs-auth0","owner":"jajaperson","description":"An example NestJS application that uses Auth0 via Passport for authentication.","archived":false,"fork":false,"pushed_at":"2023-01-23T21:59:24.000Z","size":2344,"stargazers_count":217,"open_issues_count":28,"forks_count":25,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-01T16:19:50.743Z","etag":null,"topics":["auth0","jwt","nestjs","passport","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jajaperson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-05T09:53:18.000Z","updated_at":"2025-05-27T15:16:34.000Z","dependencies_parsed_at":"2023-02-13T04:00:39.500Z","dependency_job_id":null,"html_url":"https://github.com/jajaperson/nestjs-auth0","commit_stats":null,"previous_names":[],"tags_count":12,"template":true,"template_full_name":null,"purl":"pkg:github/jajaperson/nestjs-auth0","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jajaperson%2Fnestjs-auth0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jajaperson%2Fnestjs-auth0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jajaperson%2Fnestjs-auth0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jajaperson%2Fnestjs-auth0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jajaperson","download_url":"https://codeload.github.com/jajaperson/nestjs-auth0/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jajaperson%2Fnestjs-auth0/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260369537,"owners_count":22998630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth0","jwt","nestjs","passport","typescript"],"created_at":"2024-08-03T16:00:21.397Z","updated_at":"2025-06-17T13:32:48.451Z","avatar_url":"https://github.com/jajaperson.png","language":"TypeScript","funding_links":[],"categories":["Resources"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://nestjs.com\"\u003eNestJS\u003c/a\u003e + \u003ca href=\"https://auth0.com\"\u003eAuth0\u003c/a\u003e = :heart:\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jajaperson/nestjs-auth0/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/jajaperson/nestjs-auth0?label=version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jajaperson/nestjs-auth0/actions\"\u003e\n    \u003cimg src=\"https://github.com/jajaperson/nestjs-auth0/workflows/build/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/jajaperson/nestjs-auth0\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/jajaperson/nestjs-auth0/branch/master/graph/badge.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://dependabot.com\"\u003e\n    \u003cimg src=\"https://api.dependabot.com/badges/status?host=github\u0026repo=jajaperson/nestjs-auth0\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n\nA template for using [Auth0](https://auth0.com) with the\n[Nest](https://github.com/nestjs/nest) framework. To start, either fork this\nrepository or run\n\n```bash\n$ git clone --depth 1 https://github.com/jajaperson/nestjs-auth0.git\n```\n\n## Setup\n\nYou'll need to populate a `.env` file with Auth0 configuration environemt\ndetails. This file should **never** be committed for obvious reasons (hence the\nreason it's `.gitignore`-d).\n\n```dotenv\nAUTH0_DOMAIN={your Auth0 domain}\nAUTH0_CLIENT_ID={the Auth0 client ID for your app}\nAUTH0_CLIENT_SECRET={the Auth0 client secret for your app}\nAUTH0_AUDIENCE={http://localhost:3000 or your production domain accordingly}\n```\n\nA template `.env` file can be found at [`.env.example`](.env.example).\n\nYou may also like to remove all the irrelevant metadata from the `package.json`,\nsuck as the `repository`, `homepage`, `bugs`, and `description` fields.\n\n## Installation\n\n```bash\n$ npm install\n```\n\n## Running the app\n\n```bash\n# development\n$ npm run start\n\n# watch mode\n$ npm run start:dev\n\n# production mode\n$ npm run start:prod\n```\n\n## Test\n\n```bash\n# unit tests\n$ npm run test\n\n# e2e tests\n$ npm run test:e2e\n\n# test coverage\n$ npm run test:cov\n```\n\n## Explanation\n\n### Authentication logic\n\nThis template nest app uses the [jwks-rsa](https://ghub.io/jwks-rsa) package\nalong with [passport-jwt](https://ghub.io/passport-jwt) and\n[@nestjs/passport](https://ghub.io/@nestjs/passport) for authentication. All\nauthentication logic is in the [`/src/auth/`](src/auth/) submodule.\n\n```\nsrc/auth/\n├── auth.module.ts\n├── interfaces\n│   └── jwt-payload.interface.ts\n├── jwt.strategy.spec.ts\n└── jwt.strategy.ts\n```\n\nThe [`JwtStrategy`](src/auth/jwt.strategy.ts) injectable contains all the core\nfunctionality, where the constructor sets up core token validation using the\n[jwks-rsa](https://ghub.io/jwks) library. All the Auth0 configuration for this\nis done in the [`.env`](.env.example) file using\n[@nestjs/config](https://ghub.io/@nestjs/config) (see [above](#Setup)). On any\nrequest with authentication, the decoded JSON web token (which should follow\n[`JwtPayload`](src/auth/interfaces/jwt-payload.interface.ts)) is passed to the\n`validate`, which checks the token for the required scopes.\n\nThe [`AuthModule`](src/auth/auth.module.ts) itself exports both `PassportModule`\nand the `JwtStrategy` injectable, and registers `JwtStrategy` as default.\n\n`AuthModule` is imported by [`AppModule`](src/app.module.ts), and protected\nroutes are decorated with `@UseGuards(AuthGuard())` in\n[`AppController`](src/app.controller.ts).\n\n## More info\n\nSee the [Nest documentation](https://docs.nestjs.com).\n\n## License\n\nThis project is [MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjajaperson%2Fnestjs-auth0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjajaperson%2Fnestjs-auth0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjajaperson%2Fnestjs-auth0/lists"}