Download the PHP package webthink/guzzle-jwt without Composer
On this page you can find all versions of the php package webthink/guzzle-jwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webthink/guzzle-jwt
More information about webthink/guzzle-jwt
Files in webthink/guzzle-jwt
Package guzzle-jwt
Short Description This package contains useful classes and interfaces for requiring a JWT token
License MIT
Homepage https://github.com/webthinkgr/guzzle-jwt-middleware
Informations about the package guzzle-jwt
A guzzle middleware for JWT authentication.
Goal of this package is to provide a set of useful classes in order to use a JWT authentication with Guzzle.
Install
You can install the package using composer
composer require webthink/guzzle-jwt
Usage
Basic Usage
As a first step you need to implement your own Authenticator.
Then you need to append into your handler stack the middleware provided by the package.
NOTE
I will not proceed with creating classes that implement the AuthenticatorInterface
. The AuthenticatorInterface
can be implemented by the developer who uses the package.
Storages
Storages are a way of caching JWT between multiple requests. Depending on the storage the token can for using it for more than one HTTP Request.
In order to use the storage you will need either to implement an Authenticator of your own that will use the storage
or use the StoreAuthenticator
Then you can pass the store authenticator in the middleware and follow the procedure described above.
Contributing
Feel free to comment on anything you might believe it's going in the wrong direction or even better contribute with a PR.
Todo
- Increase UnitTests.
- Investigate the possibility of including some authenticators.
Credits
License
The MIT License (MIT). Please see License File for more information.