This toolkit is for people who like to build web REST API's with token based structure like JWT using PHP. Its goal is to enable you to develop api much faster than you could if you were writing code from scratch, by providing a template for your workings with the REST API with JWT based tokens.
Release Information
This repo contains in-development code for future releases.
Features
Instruction
jwt_key
& token_expire_time
according to your need.$config['base_url']
in config.phpaccess_token
.access_token
in header for Authorization
with other data in body section.access_token
expired, you can also regenerate access_token
by providing username
.[!IMPORTANT] Initially
access_token
has been set for 1 minute.[!WARNING]
jwt_key
must be changed for your own protection in production environment.
Postman Calls & Methods
POST : http://localhost/api_jwt_ci3/register
Body |
---|
username |
password |
POST : http://localhost/api_jwt_ci3/login
Body |
---|
username |
password |
POST : http://localhost/api_jwt_ci3/logout
GET : http://localhost/api_jwt_ci3/product
Headers | Body |
---|---|
Authorization |
POST : http://localhost/api_jwt_ci3/product
Headers | Body |
---|---|
Authorization | name |
price |
PUT : http://localhost/api_jwt_ci3/product/:id
Headers | Body |
---|---|
Authorization | |
name | |
price |
DELETE : http://localhost/api_jwt_ci3/product/:id
Headers | Body |
---|---|
Authorization |
POST : http://localhost/api_jwt_ci3/reGenToken
Body |
---|
username |
Server Requirements
PHP version 5.6 or newer is recommended. It should work on 5.3.7 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features.