Skip to content

This repo used maintain the affinity auth flow using passport

License

Notifications You must be signed in to change notification settings

Raman99444/passport-affinity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

passport-affinity

Install

$ npm install passport-affinity

Usage

Configure Strategy

The affinity authentication strategy authenticates users using a userEmail and apiKey. The strategy requires a verify callback, which accepts these credentials and calls done providing a user.

passport.use(new AffinityStrategy(
  async (userEmail, apiKey, crmId, done) {
    //handle the user requirement here
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'affinity' strategy, to authenticate requests.

For example, as route middleware in an Express application:

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

Tests

$ npm install

License

The MIT License

About

This repo used maintain the affinity auth flow using passport

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages