{"_id":"@drkforums/discord-sso-drk","_rev":"1-94fb675479d01a25246fd4943afaa559","name":"@drkforums/discord-sso-drk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@drkforums/discord-sso-drk","version":"1.0.1","description":"NodeBB Discord OAuth2 SSO","main":"library.js","repository":{"type":"git","url":"git+https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo.git"},"keywords":["nodebb","plugin","oauth2","sso","single sign on","login","registration"],"author":{"name":"selkkie","email":"github@selkie.is"},"contributors":[{"name":"James Sumners","email":"james.sumners@gmail.com","url":"https://github.com/jsumners"},{"name":"Julian Lam","email":"julian@nodebb.org","url":"https://github.com/julianlam"}],"license":"MIT","bugs":{"url":"https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo/issues"},"scripts":{"lint":"standard | snazzy"},"precommit":["lint"],"dependencies":{"discord.js":"^12.2.0","passport-oauth":"~1.0.0","quick-format":"^2.1.0"},"nbbpm":{"compatibility":"^1.5","index":false},"devDependencies":{"pre-commit":"^1.2.2","snazzy":"^7.0.0","standard":"^10.0.2"},"homepage":"https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo#readme","gitHead":"9b6dc89e70af39123c3d61bbf4936e7cfbf5b3ea","_id":"@drkforums/discord-sso-drk@1.0.1","_nodeVersion":"16.9.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eQbQSz35m09tw9n1XSQJNXGsmAkVgmtK4jjU8J/FWVTQQZboM+/xTp8CHTv30H26xU4vPfzMtz2NeDvAybeB6w==","shasum":"ddc69fa4adcca969ea60fc4e98e0013fda5d3989","tarball":"https://registry.npmjs.org/@drkforums/discord-sso-drk/-/discord-sso-drk-1.0.1.tgz","fileCount":13,"unpackedSize":1348096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG7d4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSPQ//Qshqpnyf/cMYsktsjjWLrWYohqReSuERs4mbz3u3T/cRAAn3\r\nvlJxZ8eHiIDJ9df8LjVAjjFrjmiuKp958YtuXTUcSeRIHIxm2wVVBRaI7QGP\r\nP5UkeGem+l54W2jde1bzeEKJWUsp53p3rPjArWbgHlHUIh5z3dF5nbVR7qAu\r\nBnhOsN/L32HnvcNO4F248YPL1azF1RTrzKhWGqWmhkYiKP/lnkqU/V97F8R6\r\ntWNJEbx7N+iFIzkHo94fZIb5CATUB+6MhWuSX0uDNK/vfT0aa3miCwhKn9+P\r\nM7QnMcuLnHbICb3/MiD4xYI4DwYnYWV5DP1RaW1Qv9GbM7gjwpouLonoee/s\r\ntWCe2yYmPXbqj4nMUk2ztq+jn2jlDwfaYbfX6oB6YfyXbuJ9pIepaoVvIw19\r\nyrolFi4YZ2L/UnJf8Rq4VS4uM40spmwDRYzkxukwncn0eEUKHbZ1H2GMx7XU\r\nJ8JrQhSW+Nk5RsxxVpxo7qNd9uHz+4hjRd26ZQaWQ49RFtsRyPLGjeGNWlFQ\r\nCM6X7FZbqdXDd6c/4SrIvDsgMfB3y11obIcjgN83SxL1bFnoNf/QfwGyw/Q6\r\nb1FP0xXqDkoXs/H9qysnBT6EG7UUUhn928bPuykVzEP9Z1/9h2ff4ddQIM71\r\nnPyqSGj4gT2oQEnEZXKqIG1IW/3PgaKe2n0=\r\n=MtEF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6vwxF8qlKyKy7dvQ0Eirw1EHARShU59k96Y4hSikEJAIhAO0mJVptgLfqQGnAWBrBICU+nSg76CiveYesL6nVcA3R"}]},"_npmUser":{"name":"prime187","email":"primeedits187@gmail.com"},"directories":{},"maintainers":[{"name":"prime187","email":"primeedits187@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/discord-sso-drk_1.0.1_1645983607953_0.22855513744977318"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-27T17:40:07.904Z","1.0.1":"2022-02-27T17:40:08.217Z","modified":"2022-04-05T05:41:01.328Z"},"maintainers":[{"name":"prime187","email":"primeedits187@gmail.com"}],"description":"NodeBB Discord OAuth2 SSO","homepage":"https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo#readme","keywords":["nodebb","plugin","oauth2","sso","single sign on","login","registration"],"repository":{"type":"git","url":"git+https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo.git"},"contributors":[{"name":"James Sumners","email":"james.sumners@gmail.com","url":"https://github.com/jsumners"},{"name":"Julian Lam","email":"julian@nodebb.org","url":"https://github.com/julianlam"}],"author":{"name":"selkkie","email":"github@selkie.is"},"bugs":{"url":"https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo/issues"},"license":"MIT","readme":"# NodeBB Discord OAuth2 SSO \r\n\r\nThis plugin for [NodeBB](https://github.com/NodeBB/NodeBB/) provides a way to register/authenticate users against\r\n[Discord](https://discordapp.com/). When enabled, and configured properly, there will be a\r\nDiscord icon available on the login screen. Click that icon to authenticate\r\nagainst Discord.\r\n\r\nNew users who register using Discord should have their avatar carry over automatically rather than using the default avatar.\r\n\r\n## Config\r\n\r\n1. Create an application -- https://discordapp.com/developers/applications/me\r\n2. Ensure the application's URI ends with `/auth/discord/callback`\r\n3. Create a bot for your application\r\n4. Fill in the id, secret, and bot token for the application via the NodeBB admin control panel (under \"Social Authentication\")\r\n5. Replace your NodeBB FontAwesome fonts with the custom ones included (See below)\r\n6. Edit your theme's profile.tpl to include a section for Discord information. (See below)\r\n\r\n## Using the Discord Logo:\r\n\r\nI have included a modified version of the FontAwesome font that replaces the Discover card (fa-cc-discover) with a simplified Discord logo. I've picked Discover to overwrite because it starts with the same letters, so it's intuitive to search in the NodeBB icon box in case you want to use it elsewhere.\r\n\r\nYou'll have to patch this manually by replacing the font files in [public/vendor/fontawesome/fonts/](https://github.com/NodeBB/NodeBB/tree/master/public/vendor/fontawesome/fonts) with the ones in the [fontawesome-discoverToDiscord folder](https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo/tree/master/fontawesome-discoverToDiscord).\r\nI recommend keeping a copy of the folder itself in the font folder so that you can replace everything quickly everytime NodeBB upgrades, since they'll get overwritten with the default FontAwesome fonts.\r\n\r\nIf using the Discover card is unacceptable for you, you can do what I did and make your own version of the FontAwesome font using [FontForge](https://github.com/fontforge/fontforge). Just open up [one of the standard FontAweesome fonts included in NodeBB](https://github.com/NodeBB/NodeBB/tree/master/public/vendor/fontawesome/fonts), scroll down to the icon you want to replace (they're buried deep), delete it and import the svg of your choice. Then export all of the filetypes and replace them in the fontawesome folder.\r\n\r\n## Profile Information\r\nA quick panel of the user's full username and their avatar from discord can be added to their profile.\r\nJust modify profile.tpl and use\r\n```\r\n    <!-- IF discordData -->\r\n    <div class=\"panel panel-default\">\r\n        <div class=\"panel-body text-center\">\r\n            <!-- IMPORT partials/account/discord_profile_panel.tpl -->\r\n        </div>\r\n    </div>\r\n    <!-- ENDIF discordData -->\r\n```\r\nor, if you'd like to inject the data directly, use variables such as {discordData.username}.\r\nCurrently you can access username, discriminator, id, and pfp (avatar URL), but theoretically any information that can be pulled from Discord.js can be added to [DiscordAuth.filterAccount](https://github.com/selkkie/nodebb-plugin-sso-discord-with-logo/blob/69b347caa536cae9ab8a39e5c196584e4e869a0c/library.js#L324).\r\n\r\n## Local Testing URL Override\r\n\r\nI've added a setting in the admin panel that allows a workaround when testing local setups. Localhost isn't a valid OAuth URL, so to bypass this you can use [http://lvh.me](http://lvh.me), which will always resolve to 127.0.0.1. Just enter http://lvh.me:4567 (or whatever your port number is).\r\n(Don't forget to add lvh.me to your application URI in the discord application settings as well!)\r\n\r\n## To Do\r\n* Adjust inconsistencies. SSO sometimes prompts to reauth in profile, and multiple users can auth one account.\r\n* Remove association button?\r\n* Clone and upload avatar locally instead of linking to Discord server\r\n* Add button to Profile Picture editor that allows you to pull your avatar from Discord?\r\n\r\n## Acknowledgements\r\n\r\nThis plugin is built from the one at [https://github.com/jsumners/nodebb-plugin-sso-discord-alt](https://github.com/jsumners/nodebb-plugin-sso-discord-alt).\r\n\r\n## License\r\n\r\n[MIT License](http://jsumners.mit-license.org/)","readmeFilename":"README.md"}