Authentication and Authorization
The concepts of authentication—proving that the user is who they claim to be—and authorization—making sure that the authenticated user should or should not be able to perform certain operations on your API—are very complex. In this chapter, you will explore the topics of authentication and authorization from a very practical standpoint and from the FARM stack perspective.
The chapter will detail a simple yet robust and extensible setup for your FastAPI backend, based on JSON Web Token (JWT)—arguably the most popular and practical authentication method that has emerged in the last years. Then, you will see how to integrate your JWT-based authentication methods into React, leveraging some of React’s powerful features—namely, Hooks, Context, and React Router.
By the end of this chapter, you should have a solid grasp of authentication methods that both FastAPI on the backend and React on the frontend...