I've developed few web APIs using Slim framework.
I want to implement 'Token Based Authentication' to these APIs. Since this is my first time to work on 'Token Based Authentication', everything is new for me. So, I googled a lot for the solution and came to know about 'JSON Web Token (i.e. JWT)'.
I visited the URL Git repo URL for JWT but I couldn't understand how to implement JWT using PHP and MySQL into my system.
I also searched for working example of implementation of 'Token Based Authentication' using 'JSON Web Token (i.e. JWT)' in PHP and MySQL.
If someone could provide me the complete code along with MySQL database table, database connectivity with PHP, generation of security token, saving the token into respective database table, sending the security token back to calling PHP file, sending the security token in a request, validating the security token with the one that is stored in database, etc. it would be really very helpful to me.
If possible, please provide the entire code with proper step-by-step description in form of comments.