Chapter 11: Securing and Adding an API and JSON
Two of the most important aspects of a web application are authentication and authorization. In this chapter, we are going to learn how to implement simple authentication and authorization systems. After we have created these systems, we are going to learn how to create a simple Application Programming Interface (API) and how to protect the API endpoint using a JSON Web Token (JWT).
At the end of this chapter, you will be able to create an authentication system, with functionality such as logging in and logging out and setting access rights for logged-in users. You will also be able to create an API server and know how to secure the API endpoints.
In this chapter, we are going to cover these main topics:
- Authenticating users
- Authorizing users
- Handling JSON
- Protecting the API with a JWT