This is a very simple implementation of JWT (JSON Web Token) using native PHP, jQuery, and firebase/php-jwt package
This file will handler your composer package
This file will receive a username and password using POST method, and then validate the username and password, if authenticated then return the JWT Token, if not authenticated then return the error message
This file will validate a token for every request made from client (if you include this file in every php script requires token), if not validated then return an error message, if validated then return the requested resource
This is the example of endpoint to get the data resource needed by the client side, this file will require doValidateToken.php file.
This file contains a simple login form that will send an username and password using post method to the server.
This is a very simple client that request a data from the server and then update a token for every response by the server.