Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Make the library compatible with passportjs #2

Open
kurtdb opened this issue Sep 4, 2015 · 2 comments
Open

Make the library compatible with passportjs #2

kurtdb opened this issue Sep 4, 2015 · 2 comments

Comments

@kurtdb
Copy link

kurtdb commented Sep 4, 2015

Not exactly a bug, but more of a feature request.

To perform authentication using external platforms on NodeJS, passportjs (http://passportjs.org/) is a very popular library. It provides very easy integrations for different platforms (atm 307 different platforms are supported). Maybe it could be interesting to make this library compatible so people don't have to use yet another library?

An example of how the authentication could be possible through their API:

passport.use(new IBMSSOStrategy({
    callbackURL: "<the url that is to be redirected to>"
  },
  function(token, tokenSecret, profile, done) {
    // asynchronous verification, for effect...
    process.nextTick(function () {
      return done(null, profile);
    });
  }
));

app.get('/auth/ibmsso',
  passport.authenticate('ibm-sso'),
  function(req, res){
    // The request will be redirected to IBM-SSO for authentication, so this
    // function will not be called.
  });
@DTAIEB
Copy link

DTAIEB commented Sep 4, 2015

Not sure if you've looked at the code but the implementation is already using passport under the cover. The idea is to make it completely transparent to the user who only needs to pass the express app and the library will set up the passport strategy, OAuth callback, etc..
Perhaps what you're asking is to let the caller access the passport strategy?

@kurtdb
Copy link
Author

kurtdb commented Sep 8, 2015

Personally I would make it work in the same API-way like passport is using right now. Now you are abstracting away all this setup, but downside of this approach is that you are the only one using it. If tomorrow I want to use both your implementation and the passportjs implementation of linkedin, I will have 2 completely different strategies in my code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants