Creating the Authentication Middleware File

Learn how to grant and deny access to secured resources.


Middleware is software that allows two or more applications in a distributed system to communicate in one or more ways. Essentially, the middleware in the system allows the controllers and routes to communicate. For example, in order for the users to successfully access the content of the app, they must log in first. To ensure that whoever is attempting to access the data is, in fact, a user, we require some form of identification. Most of the time, this authentication takes the form of user-related data. So when we collect this information, we must run a check on it, and if it’s valid, we proceed with the request. The middleware is the system that performs the check. In short, middleware serves as a hidden layer that facilitates system communication.

Get hands-on with 1200+ tech skills courses.