There are also no dependencies on a specific framework. This means that there are no surprises, as you define where you want your routes and when you want to use authentication. Passport is just middleware, using the fn(req, res, next) convention established by Connect and Express. This modular architecture has proven itself adaptable, facilitating a community that has implemented support for a wide variety of authentication mechanisms, including OpenID, OAuth, BrowserID, SAML, etc. Passport lets you craft your application using only the dependencies you actually need. This has a number of benefits, including smaller overall code size and well defined and testable interfaces.įor a basic illustration, compare the difference between running $ npm install passport and $ npm install everyauth. Passport employs a strategy design pattern to define a clear separation of concerns between the core module and various authentication mechanisms. Much of the power of Node itself comes from this fact, and Passport follows suit. While useful in some high-level situations, I wasn't comfortable with an authentication library forcing this choice upon my application.įurthermore, I find that proper use of callbacks and closures yields concise, well architected (almost functional style) code. Promises are an alternative approach to async programming. The major points I wanted to address are:Įveryauth makes extensive use of promises, instead of Node's approach of using callbacks and closures. So, I set about implementing a different solution which would. Chiming in with my two cents, as the developer of Passport.īefore developing Passport, I evaluated everyauth and determined that it didn't meet my requirements.
0 Comments
Leave a Reply. |