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 introduced OAuth 2.0, an authentication framework. There, we saw how the client requests a grant from the resource owner. Once it gets the grant...