Passport IMAP – IMAP authentication strategy for Passport

///Passport IMAP – IMAP authentication strategy for Passport

Passport IMAP – IMAP authentication strategy for Passport

Passport IMAP is an authentication strategy for the Passport module. This module serves the purpose of authenticating a user using IMAP login credentials in Node.js application using the Passport authentication module.

Installation

npm install passport-imap

Usage

Configure Strategy

The imap authentication strategy authenticates users using imap login information. The strategy requires some options like imap host name, port and tls

passport.use(new ImapStrategy({host: 'imap.gmail.com', port : 993, tls : true}));

Authenticate Requests

Use passport.authenticate(), specifying the ‘imap’ strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.post('/login', passport.authenticate('imap', { failureRedirect: '/login' }),
  function(req, res) {
  res.redirect('/');
});

License

The MIT License

Are you looking for scalable web-applications developed on Node.JS? Contact us at  or by filling in the form at www.nettantra.com/contact, we can certainly help you out with it.

By |2014-07-18T00:34:06+00:00July 15th, 2014|JavaScript, Node.JS|0 Comments

About the Author:

Leave A Comment