{"id":19052396,"url":"https://github.com/oauth-everything/passport-discord","last_synced_at":"2025-10-06T00:56:52.548Z","repository":{"id":35136151,"uuid":"211386959","full_name":"oauth-everything/passport-discord","owner":"oauth-everything","description":"A Passport strategy for authenticating with https://discordapp.com/","archived":false,"fork":false,"pushed_at":"2022-12-14T00:40:43.000Z","size":116,"stargazers_count":19,"open_issues_count":11,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-01T13:52:07.038Z","etag":null,"topics":["authentication","discord","discordapp","nodejs","passportjs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oauth-everything.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-27T19:18:34.000Z","updated_at":"2024-11-13T05:50:39.000Z","dependencies_parsed_at":"2023-01-15T14:33:22.430Z","dependency_job_id":null,"html_url":"https://github.com/oauth-everything/passport-discord","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oauth-everything/passport-discord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-everything%2Fpassport-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-everything%2Fpassport-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-everything%2Fpassport-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-everything%2Fpassport-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oauth-everything","download_url":"https://codeload.github.com/oauth-everything/passport-discord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oauth-everything%2Fpassport-discord/sbom","scorecard":{"id":700736,"data":{"date":"2025-08-11","repo":{"name":"github.com/oauth-everything/passport-discord","commit":"7f2ca1f92a9b22ad42f5b79c451ac4b124379556"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: Mozilla Public License 2.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"23 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-v923-w3x8-wh69","Warn: Project is vulnerable to: GHSA-f794-r6xc-hf3v","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T05:09:31.764Z","repository_id":35136151,"created_at":"2025-08-22T05:09:31.764Z","updated_at":"2025-08-22T05:09:31.764Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542675,"owners_count":26004061,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["authentication","discord","discordapp","nodejs","passportjs"],"created_at":"2024-11-08T23:26:14.701Z","updated_at":"2025-10-06T00:56:52.526Z","avatar_url":"https://github.com/oauth-everything.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@oauth-everything/passport-discord\n==================================\n\n[![Version][version-badge]][version-link]\n[![Dependencies][dependencies-badge]][dependencies-link]\n[![Dev Dependencies][dev-dependencies-badge]][dev-dependencies-link]\n[![Vulnerabilities][vulnerabilities-badge]][vulnerabilities-link]\n[![License][license-badge]][license-link]\n[![Types][types-badge]][types-link]\n\n*A fully typed [Passport][passport-link] strategy for authenticating users with [Discord][discord-link] using OAuth 2.0 and the Discord API.*\n\n[Passport][passport-link] is authentication middleware for Node.js. It allows you to easily add user authentication to your application. It supports any application using [Connect][connect-link]-style middleware, including [Express][express-link].\n\n`@oauth-everything/passport-discord` is an authentication Strategy for [Passport][passport-link] that allows users to authenticate using their [Discord][discord-link] account.\n\n## Installation\n\n```bash\n$ npm install @oauth-everything/passport-discord\n```\n\n## Setup/Configuration\n\n\u003cdetails\u003e\n\u003csummary\u003eTypescript Example\u003c/summary\u003e\n\n```ts\nimport express from 'express';\nimport passport from 'passport';\n\n// Import the strategy and types from @oauth-everything/passport-discord\nimport { Strategy, Profile, VerifyCallback /*, Scope*/ } from '@oauth-everything/passport-discord';\n\n// Set up express/connect/etc\nconst app = express();\napp.use(...);\n...\n...\n\n// Set up passport\npassport.serializeUser((user: User, done) =\u003e {\n    done(null, /* user.id */);\n})\npassport.deserializeUser((id: string, done) =\u003e {\n    done(null, /* database.getUserById(id) */);\n});\n...\n...\n\n// Set up the Discord Strategy\npassport.use(new Strategy(\n    {\n        // The Client Id for your discord application (See \"Discord Application Setup\")\n        clientID: \"wumpus\",\n\n        // The Client Secret for your discord application (See \"Discord Application Setup\")\n        clientSecret: \"supmuw\",\n\n        // The callback URL - Your app should be accessible on this domain. You can use\n        // localhost for testing, just makes sure it's set as a Redirect URL (See \"Discord Application Setup\")\n        callbackURL: \"https://myapp.com/auth/discord/callback\",\n\n        /* Optional items: */\n\n        // The scope for your OAuth request - You can use strings or Scope values\n        // The default scope is Scope.IDENTIFY which gives basic profile information\n        scope: [Scope.EMAIL, Scope.GUILDS_JOIN, \"webhook.incoming\", ...]\n\n    },\n    (accessToken: string, refreshToken: string, profile: Profile, cb: VerifyCallback\u003cUser\u003e) =\u003e {\n\n        // `profile` will be the user's Discord profile\n        console.log(profile);\n\n        // You should use that to create or update their info in your database/etc and then return the user using `cb`\n        cb(null, /* database.createOrUpdateDiscordUser(profile) */)\n\n    }\n));\n\n// Connect passport to express/connect/etc\napp.get(\"/auth/discord\", passport.authenticate(\"discord\"));\napp.get(\"/auth/discord/callback\", passport.authenticate(\"discord\", {\n    failureRedirect: \"/login\",\n    successRedirect: \"/\"\n}));\n\n// Start the app\napp.listen(80);\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eJavascript Example\u003c/summary\u003e\n\n```js\nconst express = require('express');\nconst passport = require('passport');\n\n// Import the strategy from @oauth-everything/passport-discord\nconst { Strategy /*, Scope*/ } = require('@oauth-everything/passport-discord');\n\n// Set up express/connect/etc\nconst app = express();\napp.use(...);\n...\n...\n\n// Set up passport\npassport.serializeUser((user, done) =\u003e {\n    done(null, /* user.id */);\n})\npassport.deserializeUser((id, done) =\u003e {\n    done(null, /* database.getUserById(id) */);\n});\n...\n...\n\n// Set up the Discord Strategy\npassport.use(new Strategy(\n    {\n        // The Client Id for your discord application (See \"Discord Application Setup\")\n        clientID: \"wumpus\",\n\n        // The Client Secret for your discord application (See \"Discord Application Setup\")\n        clientSecret: \"supmuw\",\n\n        // The callback URL - Your app should be accessible on this domain. You can use\n        // localhost for testing, just makes sure it's set as a Redirect URL (See \"Discord Application Setup\")\n        callbackURL: \"https://myapp.com/auth/discord/callback\",\n\n        /* Optional items: */\n\n        // The scope for your OAuth request - You can use strings or Scope values\n        // The default scope is Scope.IDENTIFY which gives basic profile information\n        scope: [Scope.EMAIL, Scope.GUILDS_JOIN, \"webhook.incoming\", ...]\n\n    },\n    (accessToken, refreshToken, profile, cb) =\u003e {\n\n        // `profile` will be the user's Discord profile\n        console.log(profile);\n\n        // You should use that to create or update their info in your database/etc and then return the user using `cb`\n        cb(null, /* database.createOrUpdateDiscordUser(profile) */)\n\n    }\n));\n\n// Connect passport to express/connect/etc\napp.get(\"/auth/discord\", passport.authenticate(\"discord\"));\napp.get(\"/auth/discord/callback\", passport.authenticate(\"discord\", {\n    failureRedirect: \"/login\",\n    successRedirect: \"/\"\n}));\n\n// Start the app\napp.listen(80);\n```\n\n\u003c/details\u003e\n\n\n## Discord Application Setup\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\n1. Go to https://discordapp.com/developers/applications and create a New Application\n\n   ![asdf](https://p.cp3.es/discord-oauth-1.png)\n   ![asdf](https://p.cp3.es/discord-oauth-2.png)\n\n2. Copy the Client ID and Client Secret and save them somewhere safe\n\n   ![asdf](https://p.cp3.es/discord-oauth-3.png)\n\n3. Go to the OAuth tab and add a redirect URL - this will be the URL on your website where Passport is set up\n\n   ![asdf](https://p.cp3.es/discord-oauth-4.png)\n   ![asdf](https://p.cp3.es/discord-oauth-6.png)\n\n\u003c/details\u003e\n\n\n## License\n\n[The MPL v2 License](https://opensource.org/licenses/MPL-2.0)\n\n\n\u003c!-- Link References --\u003e\n\n[passport-link]: http://passportjs.org/\n[connect-link]: https://www.senchalabs.org/connect/\n[express-link]: https://expressjs.com/\n[discord-link]: https://www.discord.com/\n\n[version-badge]: https://img.shields.io/npm/v/@oauth-everything/passport-discord\n[version-link]: https://github.com/oauth-everything/passport-discord\n\n[types-badge]: https://img.shields.io/npm/types/@oauth-everything/passport-discord\n[types-link]: https://github.com/oauth-everything/passport-discord\n\n[license-badge]: https://img.shields.io/npm/l/@oauth-everything/passport-discord\n[license-link]: https://github.com/oauth-everything/passport-discord/blob/master/LICENSE.md\n\n[dependencies-badge]: https://david-dm.org/oauth-everything/passport-discord/status.svg\n[dependencies-link]: https://david-dm.org/oauth-everything/passport-discord\n\n[dev-dependencies-badge]: https://david-dm.org/oauth-everything/passport-discord/dev-status.svg\n[dev-dependencies-link]: https://david-dm.org/oauth-everything/passport-discord?type=dev\n\n[vulnerabilities-badge]: https://snyk.io/test/npm/@oauth-everything/passport-discord/badge.svg\n[vulnerabilities-link]: https://snyk.io/test/npm/@oauth-everything/passport-discord\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauth-everything%2Fpassport-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foauth-everything%2Fpassport-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauth-everything%2Fpassport-discord/lists"}