Thursday 21 March 2019

Searching for Best Online Tutorial to learn Expressjs+MongoDB user authentication

I have searched extensively for an extended tutorial, showing how to develop a middleware in expressjs and how to handle the frontend part in authenticating a user. However , I couldn't get any tutorial explaining the same in a more detailed manner. Specifically I'm searching, for the following gaps on the subject matter.In case the user is authenticated for the first time, the server sends a JWT JSON Web Token to the browser.Now, do I need to put this on the request header every time I call a route in the server ?What do I need to do in the front end in order to make the user authentication system to work?I have followed the facility given by the passport.js (local strategy). However, there is no explanations that tells what does the method call back do and how do they work internally.In case I'm authenticating a user using cookies, how to persistently store the JWT across the browser tabs securely.I followed a tutorial that has only shown the code for JWT user authentication without using passport.js. I have been trying to understand how the JWT user authentication works. However, I'm getting No authorisation error, even after a new user signs up and the server sends a JWT to the browser.​UnauthorizedError: No authorization token was found You can find the code here (https://glitch.com/edit/#!/quiver-stoat)Please comment and see if you can helpThanks.

Submitted March 22, 2019 at 02:21AM by iaminbadland

No comments:

Post a Comment