From the course: Node: Authentication
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Implementing local authentication with Passport.js
From the course: Node: Authentication
Implementing local authentication with Passport.js
- [Instructor] We are now going to implement so-called Passport Strategy, that tries to authenticate the user against the database. To kick this off, you first have to of course installed Passport and also the Local Strategy Module. For that, I'm stopping the Node.js process by pressing Control C in the console and there now type npm install -S passport passport-local. So that's the LocalStrategy. The LocalStrategy is always used when you have to implement your own logic on how credentials should be verified. In our case, now this means that we will validate against MongoDB. I already prepared the empty module where we will implement all the authentication logic. So I'm going to open Server, Lib, and in there, there is Passport in the Index.js file. So you see, this is an empty module, we just load the user service there already because we will use it to talk to the MongoDB. I will also start the Node.js process again…
Contents
-
-
-
-
-
Using Passport.js for authentication1m 55s
-
(Locked)
Implementing local authentication with Passport.js16m 18s
-
(Locked)
Securing routes4m 24s
-
(Locked)
Set up and understand the ToDo list sample application6m 9s
-
(Locked)
Authenticating API calls8m 5s
-
(Locked)
Creating and sending JWT tokens8m 3s
-
(Locked)
Implementing JWT authentication with passport15m 29s
-
(Locked)
Ensuring object level authorization4m 25s
-
-
-