Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the relationship between PassportJS & Auth0?

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?

like image 555
R. Kohlisch Avatar asked Sep 18 '19 09:09

R. Kohlisch


People also ask

What are Passportjs strategies?

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.

What is Passportjs used for?

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.

How does Passport js authentication work?

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.

What does req login do?

This function is primarily used when users sign up, during which req. login() can be invoked to automatically log in the newly registered user.


1 Answers

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.

like image 86
MKougiouris Avatar answered Oct 19 '22 23:10

MKougiouris