{"id":14989887,"url":"https://github.com/cometkim/fastify-auth0-login","last_synced_at":"2026-02-22T18:30:17.101Z","repository":{"id":94369091,"uuid":"608123408","full_name":"cometkim/fastify-auth0-login","owner":"cometkim","description":"A Fastify plugin for easily adding login feature via Auth0's Authorization Code Flow","archived":true,"fork":false,"pushed_at":"2024-08-02T09:53:45.000Z","size":2500,"stargazers_count":7,"open_issues_count":11,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T14:38:56.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cometkim.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-01T11:19:46.000Z","updated_at":"2024-08-02T17:00:48.000Z","dependencies_parsed_at":"2023-12-30T05:18:54.938Z","dependency_job_id":"4f67373e-f592-4884-9ba3-0b32234c8882","html_url":"https://github.com/cometkim/fastify-auth0-login","commit_stats":{"total_commits":45,"total_committers":4,"mean_commits":11.25,"dds":0.3111111111111111,"last_synced_commit":"79c7f4064fd3c614e35ab63cad9d12ff29e59b0b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Ffastify-auth0-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Ffastify-auth0-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Ffastify-auth0-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Ffastify-auth0-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometkim","download_url":"https://codeload.github.com/cometkim/fastify-auth0-login/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239681644,"owners_count":19679629,"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":[],"created_at":"2024-09-24T14:19:04.834Z","updated_at":"2026-02-22T18:30:17.034Z","avatar_url":"https://github.com/cometkim.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-auth0-login\n\nA Fastify plugin for easily adding login feature via Auth0's [Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow).\n\n\u003e [!NOTE]\n\u003e This demonstrates bare minimum implementation for session-based authentication with a external provider. Since its lack of capabilities, I'd like to recomment not to use for your production. Instead, consider using some other frameworks such as [Auth.js](https://authjs.dev/) or [account-js](https://www.accountsjs.com/).\n\n## Prerequisites\n\n- Fasyify v4.x+\n- [@fastify/cookie](https://github.com/fastify/fastify-cookie)\n\n## Usage\n\nFirst, you need to create a Auth0 application.\n\nConfirm the `Domain`, `Client ID`, and `Client Secret` then set you application's `Login URL`, `Allowed Callback URL`, and `Allowd Web Origins`.\n\nFor example to set for `https://localhost:3000`,\n\n![Example Callback URLs](https://user-images.githubusercontent.com/9696352/222125267-76e435f6-6874-48fa-872e-99fbcf87148f.png)\n\nThen configure your Fastify app with this plugin and `@fastify/cookie` like this:\n\n```ts\nimport FastifyCookie from '@fastify/cookie';\nimport FastifyAuth0Login from 'fastify-auth0-login';\n\napp.register(FastifyCookie, {\n  secret: COOKIE_SECRET,\n});\n\napp.register(FastifyAuth0Login, {\n  auth0: {\n    domin: YOUR_AUTH0_DOMAIN,\n    clientId: YOUR_AUTH0_CLIENT_ID,\n    clientSecret: YOUR_AUTH0_CLIENT_SECRET,\n  },\n  verifySession: (_req, sessionId) =\u003e {\n    return findSession(sessionId);\n  },\n  confirmSession: (_req, sessionId, idTokenClaims) =\u003e {\n    return findOrCreateSession(sessionId, idTokenClaims);\n  },\n});\n```\n\nNow you can initiate auth flow by GET `/auth/request`.\n\n```html\n\u003c!-- In your /login page HTML --\u003e\n\u003c!-- This will redirect user to the Auth0 application's auth URL --\u003e\n\u003ca href=\"/auth\"\u003eLogin with Auth0\u003c/a\u003e\n```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Ffastify-auth0-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometkim%2Ffastify-auth0-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Ffastify-auth0-login/lists"}