passport-xmpp
v1.0.5
Published
XMPP authentication strategy for Passport.
Downloads
9
Readme
passport-xmpp
Passport strategy for authenticating with an XMPP account.
This module lets you authenticate using an XMPP account in your Node.js applications. By plugging into Passport, XMPP authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
Note: This strategy isn't recommended for use unless:
- Users are able and willing to trust your service
- Users are using a SASL authentication mechanism that does not involve them revealing their true password
We don't currently support setting a SASL mechanism but pieces are in place, if required please raise an issue and we'll finish off the code. Thanks!
Install
$ npm install passport-xmpp
Usage
Configure Strategy
This authentication strategy authenticates users using an XMPP account. The strategy requires a verify
callback, which accepts these
credentials and calls done
providing a user.
passport.use(new XmppStrategy());
Authenticate Requests
Use passport.authenticate()
, specifying the 'xmpp'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.post('/login',
passport.authenticate('xmpp', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
Tests
$ npm install
$ npm test
Credits
This module has been highly influenced by passport-local by Jared Hanson.