Disqus SSO Express middleware
Express middleware aimed to make SSO with Disqus a little easier.
It does not replaces all the code you need to implement SSO with Disqus in your web app, it just tries to provide a more elegant solution to the backend code. See the Disqus docs for more information.
Installation
npm install --save disqus-sso-express
How to use
In the following example we are using passport
to handle authentication via Twitter OAuth server. You can use
the authentication method you want, but have in mind that disqus-sso-express
middleware expects to have an
object in the req.user
property.
// Get `express` instancevar app = // Require disqus-sso-express module and instantiate it with your API credentialsvar disqus = publicKey: 'your disqus public key' secret: 'your disqus secret' // Login route. A `req.user` object should be generated before putting the `disqus.login` middlewareapp; // Logout routeapp;
Contributing
If you find a bug, want a feature or have a question, open an issue. PRs are also accepted.