jwt token , as many times you hit api using post it, you will get a token 
Files and steps to make json web token authentication jwt auth in code igniter ... 
1. You need to create a login function inside your login controller(AuthController), that will check your id and password inside the database then issue you a jwt token on successful login .. $token = JwtService::generateToken(['username' => $username]); .. 
2. in the same controller AuthController $userData = JwtService::validateToken($token); we can validate the token to get back the user from the token, and once we get the user then , we can use it in the filter.. 
3. using composer you need to install the firebase/jwt-php support from the root of your project to make it enable. 
4. In  .htaccess file need to add these 3 lines, otherwise bearer given from postman will not be visible in your request. 
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
===---==
5. you need to create a filter, in your filter folder , that will act as a middleware so that , so many pages you can validate with it. this filter main function is to validate your token. 
6. you need to register your filter into config/filters.php file , in alises, so that it can be used as filter to secure other routes. 
7. inside the config folder you need to create JWT.php file , to set your "secret key" and expiration time of each and every token .3600/1hr 
8. In app/services folder you need to make JwtService class and then make two functions inside it, generateToken and ValidateToken , that will be using the function return JWT::encode($payload, JWTConfig::$secretKey,'HS256'); and $decoded = JWT::decode($token, new Key(JWTConfig::$secretKey, 'HS256')); respectively. 
9. in routes.php file you can set the route as $routes->get('api/products/(:num)', [ProductController::class, 'getProduct/$1'],['filter' => 'jwt']);
Happy Coding - we made this using code igniter, if you call me at 7895270333, i will give you code related file and also help you in implementing this at your end.  

{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MTkzOTYyMjgsImV4cCI6MTcxOTM5OTgyOCwiZGF0YSI6eyJ1c2VybmFtZSI6ImFkbWluIn19.T6ztC1YkRh6tIiF1UWGc7L49HQd0Utxmerz9LQODcgw"}