Skip to content

joewoodhouse/passport-echosign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passport-EchoSign

Passport strategy for authenticating with EchoSign using the OAuth 2.0 API.

This module lets you authenticate using EchoSign in your Node.js applications. By plugging into Passport, EchoSign authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Usage

Configure Strategy

The EchoSign authentication strategy authenticates users using a EchoSign account and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a app ID, app secret, and callback URL.

passport.use(new EchoSignStrategy({
    clientID: ECHOSIGN_APP_ID,
    clientSecret: ECHOSIGN_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/echosign/callback"
  }, function (accessToken, refreshToken, profile, done) {
// store credentials, etc
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.get('/auth/echosign', passport.authenticate('echosign'));

app.get('/auth/echosign/callback',
  passport.authenticate('echosign', { failureRedirect: '/login' }),
  function(req, res) {
    // Successul authentication, redirect home.
    res.redirect('/');
  });

Credits

Created by Joe Woodhouse

Code based on passport-mailchimp by Brian Falk

License

The MIT License

About

EchoSign authentication strategy for Passport

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published