Skip to content

idchoi2/sp-simple-jwt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#JWT on PHP

##Disclaimer

By no means should this code ever be used in production ready applications nor be executed on production servers. No security checks and/or validations were enforced. This code was written for educational purposes only, having the scope to showcase basic functionality. Performance, efficiency, security, or reusability were not a priority.

##Install

Run composer install to install all the library dependencies.

Please create a config file config/config.php with the desired signing key and your MySQL database credentials. You can use the file config/config.php.dist as a template.

Additionally create the following table in your database:

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

id and username fields should be pretty straight forward. The password field has to be generated using the password_hash() function in PHP

About

JSON web tokens

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 46.4%
  • HTML 28.2%
  • JavaScript 21.6%
  • CSS 3.1%
  • ApacheConf 0.7%