This post will go over how to include JWT (Json Web Token) authentication into an existing Lumen API. JWT is a standard for API authentication that is URL safe, and can pass manage small amounts of state too. You may have to edit more files depending on what state your API is already in but if you have an existing API you should be able to manage this. It is assumed that the existing api is just the result of creating a basic Lumen project with the composer tool.
Lumen is a micro-framework written in PHP by the designers of Laravel. I needed to learn how to use an API that is written PHP. The reason for this is that unlike Python or Java frameworks, PHP can be dropped on almost any web hosting site there is, whereas other languages require more specialised hosting. API Setup Setting up Lumen is a fairly well documented process but I will go over some of the parts that tripped me up initially.