mvdstam / php-jwt-middleware

PSR-7 compliant middleware to handle incoming JWT's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP JWT Middleware

This package allows developers to add simple but powerful middleware to their application which does one thing, and one thing only: validate incoming JWT's.

Requirements

Goal of this package

This package aims to provide the developer with a PSR-7 compliant HTTP middleware class that ensures the validity and integrity of incoming JWT's. When a JWT is found valid, it is simply added to the request as an attribute. Within the application, the JWT can simply be accessed using the current ServerRequestInterface implementation for your application:

class MyController
{
    public function indexAction(ServerRequestInterface $request)
    {
        $jwt = $request->getAttribute('jwt'); // Instance of Lcobucci\JWT\Token 
    }
}

About

PSR-7 compliant middleware to handle incoming JWT's


Languages

Language:PHP 100.0%