docusign / passport-docusign

The official DocuSign Passport package
MIT License
7 stars 7 forks source link

Update the example please #2

Closed LeoMoonStar closed 5 years ago

LarryKlugerDS commented 6 years ago

Hi, I'm working on an updated example that uses async/await, promises, etc. I plan to publish it around week of July 30th. Thank you for your interest!

LeoMoonStar commented 6 years ago

I somehow find the sample code for configure in this repo is different from that on Passport website. I am just wondering what makes the difference passport.use(new LocalStrategy( function(username, password, done) { User.findOne({ username: username }, function (err, user) { if (err) { return done(err); } if (!user) {

passport.use(new DocusignStrategy({ clientID: DOCUSIGN_INTEGRATOR_KEY, clientSecret: DOCUSIGN_APP_SECRET, callbackURL: "http://localhost:3000/auth/docusign/callback" }, function(accessToken, refreshToken, profile, cb) { User.findOrCreate({ email: profile.email }, function (err, user) { return cb(err, user); }); } ));

LarryKlugerDS commented 6 years ago

https://github.com/docusign/docusign-code-examples/tree/master/node may be of help

mmallis87 commented 5 years ago

DocuSign uses OAuth2 standard, which is completely different from the so-called "Basic Authentication" (i.e. username/password) that is implemented by LocalStrategy. Facebook have a similar Passport.js implementation, sinc they also use OAuth2: https://github.com/jaredhanson/passport-facebook#configure-strategy