Jason Web Token API client is a library to facilitate consuming API's that require JWT token as authentication.
$ composer require bernardosilva/jwt-api-client-php
use BernardoSilva\JWTAPIClient\APIClient;
$username = 'your-username';
$password = 'your-password';
$baseURI = 'api.your-domain.pt';
$credentials = new UsernameAndPasswordCredentials($username, $password);
// When using internally with other services can generate accessToken directly
$accessToken = $JWTManager->create($user);
$credentials = new AccessTokenCredentials($accessToken);
$client = new APIClient($baseURI, $credentials);
// e.g. Request types
$client->get();
$client->delete();
$client->patch();
$client->post();
$client->put();
- Fork project
- Clone it to your machine
- Install dependencies using
composer install
- Open a Pull Request
$ ./vendor/bin/phpunit
The source code is licensed under GPL v3. License is available here.