{"id":23236736,"url":"https://github.com/pratikpc/passport-jwt-firebase","last_synced_at":"2025-08-19T23:30:52.068Z","repository":{"id":57320123,"uuid":"280005080","full_name":"pratikpc/passport-jwt-firebase","owner":"pratikpc","description":"An Interface to Support JWT Auth with Passport","archived":false,"fork":false,"pushed_at":"2020-07-26T00:08:17.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-14T14:49:53.714Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pratikpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-15T23:34:45.000Z","updated_at":"2021-10-11T09:21:49.000Z","dependencies_parsed_at":"2022-08-25T21:01:02.942Z","dependency_job_id":null,"html_url":"https://github.com/pratikpc/passport-jwt-firebase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fpassport-jwt-firebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fpassport-jwt-firebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fpassport-jwt-firebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2Fpassport-jwt-firebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratikpc","download_url":"https://codeload.github.com/pratikpc/passport-jwt-firebase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374292,"owners_count":18216043,"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-12-19T04:12:36.234Z","updated_at":"2024-12-19T04:12:36.776Z","avatar_url":"https://github.com/pratikpc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PASSPORT JWT FIREBASE\n\nThis Library helps you use JWT Strategy with Passport and Firebase Auth\n\nUsage of this Library is very simple\n\n## Functions\n\n### `async TokenLoader.Load(timeout = 2 hours in MS)`\n\nUsed to Load Google Auth tokens\n\nUpdates Token List every 2 hours by default\n\nIf Tokens don't match during checking, tokens get updated again\n\nNot mandatory to call this method although first time check may fail if not called\n\n### `FirebaseStrategy`\n\nMain Strategy used. Link it with passport using `passport.use(new FirebaseStrategy());`\n\n`constructor(options: JWTStrategyOptions, verfiedCallback)`\n\nBoth Parameters are Optional\n\nPass JWT Strategy Options as the First param and pass callback function about what to do when verfied\n\n## [EXAMPLES](/samples/index.ts)\n\n```ts\nimport express, { Application, Request, Response } from \"express\";\nimport bodyParser from \"body-parser\";\nimport passport from \"passport\";\nimport FirebaseStrategy, { TokenLoader } from \"passport-jwt-firebase\";\n\nTokenLoader.Load(); // Note is Async\nconst app: Application = express();\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: true }));\n\npassport.use(new FirebaseStrategy());\napp.use(passport.initialize());\napp.use(passport.authenticate(\"jwt\", { session: false }));\n\napp.use(\n  \"/\",\n  passport.authenticate(\"jwt\", { session: false }),\n  (req: Request, res: Response) =\u003e {\n    if (req.isUnauthenticated()) return res.status(401);\n    const user = {\n      ...req.user!,\n      authenticated: req.isAuthenticated(),\n    };\n    console.log(user);\n    return res.json(user);\n  }\n);\n\nconst Port = Number(process.env.PORT || 8000);\napp.listen(Port, (err) =\u003e {\n  if (err) {\n    return console.error(err);\n  }\n  console.log(`Server is listening on ${Port}`);\n  console.log(`To Query, send Bearer token to localhost:${Port}`);\n  console.log(\n    `Generate Firebase Bearer Token at https://pratikpc.github.io/google-firebase-auth-token/`\n  );\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fpassport-jwt-firebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikpc%2Fpassport-jwt-firebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fpassport-jwt-firebase/lists"}