I thought it was PassportJS
vs. Auth0
. Now I just discovered that there is a PassportJS strategy called passport-auth0 - which confuses me. Could somebody explain this to me?
Here it says that Passport is authentication middleware for Node.js that can be unobtrusively dropped into any Express-based web application.
- I'm not sure I understand this?
Strategies are responsible for authenticating requests, which they accomplish by implementing an authentication mechanism. Authentication mechanisms define how to encode a credential, such as a password or an assertion from an identity provider (IdP), in a request.
Passport is a popular, modular authentication middleware for Node. js applications. With it, authentication can be easily integrated into any Node- and Express-based app. The Passport library provides more than 500 authentication mechanisms, including OAuth, JWT, and simple username and password based authentication.
The “Passport JS” library connects with the “expression-session” library, and forms the basic scaffolding to attach the (authenticated) user information to the req. session object. The main Passport JS library deals with already authenticated users, and does not play any part in actually authenticating the users.
This function is primarily used when users sign up, during which req. login() can be invoked to automatically log in the newly registered user.
PassportJS is a javascript framework/middleware designed to assist with authentication/authorization mechanisms in your platform. One of the ways you can use it is along with an oAuth flow. An other would be to use it only with JWTs. A third way could be to use it alongside simple "cookies".
Think of it a little bit like saying Visual Studio vs C#. You can write c# with visual studio. And you can write vb with visual studio.
Similarly you can either use oAuth,JWTs,simple cookies, or anything else that you want to use as authentication/authorization for your application, and passportJS can make it easier for you by handling some stuff, regardless of which "strategy" you choose to implement for your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With