Authentication is one of those topics that seems like it would be simple. A user submits a username and password, the server verifies the credentials, and the application returns a token.
But a secure authentication system involves more than just generating a JSON Web Token (JWT). You also need to think about password storage, access and refresh tokens, token rotation, session management, logout, concurrent requests, authorization, CSRF protection, rate limiting, input validation, CORS, secure cookies, database consistency, security monitoring, and...the list goes on.
In this handbook, we'll examine an authentication and authorization architecture for a full-stack application built with Angular, NestJS, MongoDB, and Redis.β¦