Skip to content

BernardoSilva/jwt-api-client-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JWT API Client for PHP

Jason Web Token API client is a library to facilitate consuming API's that require JWT token as authentication.

Latest Stable Version Total Downloads Build Status License

How to Install

$ composer require bernardosilva/jwt-api-client-php

How to use

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();

How to contribute

  • Fork project
  • Clone it to your machine
  • Install dependencies using composer install
  • Open a Pull Request

How to test

$ ./vendor/bin/phpunit

Created by

License

The source code is licensed under GPL v3. License is available here.

About

PHP API Client to facilitate consuming JWT protected API's

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages