Auth middleware will be nothing more than a piece of code that will validate an authentication token and will try to resolve the user against that authentication token. It will be just a piece of code that will be attached to some endpoints in the routes or place from where the data for the endpoint is being returned. In any case, it will execute before the actual code for the endpoint and will validate and resolve the user from the auth token in Request.
In Chapter 6, Illuminating RESTful Web Services with Lumen, we will look into middleware and in Chapter 7, Improving RESTful Web Services, we will write code for authentication middleware.