Download the PHP package soluble/wallit without Composer
On this page you can find all versions of the php package soluble/wallit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download soluble/wallit
More information about soluble/wallit
Files in soluble/wallit
Package wallit
Short Description PSR-15 JWT middleware
License MIT
Homepage https://github.com/belgattitude/soluble-wallit
Informations about the package wallit
soluble-wallit
PSR-15 Middleware for dealing with JWT generation and checks.
Status: Experimental. Not yet used in production, if interested take a look at the issues and feel welcome to make suggestions or open P/R :)
Requirements
- PHP 7.1
Recommended
- zend-expressive 3.0 (or any PSR-7 & PSR-15 compatible framework)
For zend-expressive 2.0 use the 0.3 release.
Install
Configure
Copy soluble-wallit.config.php.dist in your autoload directory.
Edit the config file and add your token keys
Register (zend-expressive 3.0)
Ensure Soluble\Wallit\Config\ConfigProvider::class
is registered in the ./config/config.php
file.
Usage (zend-expressive 3.0)
To quickly browse the examples, see the smoke tests directory.
Example 1
Create a PSR-15 handler to generate a JWT token upon successful authentication:
Its related factory can be:
Add a route in ./config/routes.php
Example 2: Check JWT
Simply pipe or add the JwtAuthMiddleware::class
to the desired route.
As an example in the ./config/routes.php
file :
Example 3: Retrive the token
The token is available as a request attribute: $request->getAttribute(JwtAuthMiddleware::class)
.
Standards
- fig/http-message-util Utility classes and constants for use with PSR-7 (psr/http-message)
- psr/http-message Common interface for HTTP messages (PHP FIG PSR-7)
- psr/container Common Container Interface (PHP FIG PSR-11)
- PSR 4 Autoloader
- PSR 2 Coding Style Guide
All versions of wallit with dependencies
fig/http-message-util Version ^1.1.2
lcobucci/jwt Version ^3.2.2
psr/container Version ^1.0
psr/http-message Version ^1.0.1
psr/http-factory Version ^1.0
psr/http-server-middleware Version ^1.0
zendframework/zend-diactoros Version ^1.8 || ^2.0