- PHP >= 5.4
- firebase/php-jwt
composer require jasonroyle/li3_jwt
Make the application aware of the libraries by adding the following to app/config/bootstrap/libraries.php
.
/**
* Add some plugins:
*/
Libraries::add('li3_jwt');
/**
* Load composer libraries
*/
require_once(dirname(LITHIUM_APP_PATH) . '/vendor/autoload.php');
Add the following configuration to app/config/bootstrap/session.php
replacing ***SECRET***
with your secret string.
use lithium\storage\Session;
Session::config(['default' => [
'adapter' => 'Token',
'header' => 'Authorization',
'prefix' => 'Bearer ',
'strategies' => ['Jwt' => [
'secret' => '***SECRET***'
]]
]]);