https://www.codeofaninja.com/rest-api-authentication-example-php-jwt-tutorial/
REST API Authentication Example in PHP - JWT Tutorial