Summary
In this chapter, we introduced the process of authentication. We saw how authentication usually works. Authentication can be of three types: basic authentication, session-based, or token-based. With basic authentication, every HTTP request supplies a username and password. Session-based authentication uses a saved session to authenticate a client.
Sessions stored in program memory are lost once a web server crashes/restarts. Redis can be used with a package called redistore to help store session cookies.
Next, we learned about JWT, a token-based authentication whereby a client requests a JWT token from the server. Once the client has the JWT token, it can pass that token in the HTTP header while requesting API resources.
We then ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access