cvogit/lumen-jwt

An implementation of firebase/php-jwt for Lumen, a Laravel micro framework.

v1.0.3 2017-10-13 17:52 UTC

README

LumenJWT is an Http guard for Lumen, a Laravel micro framework.

  • Create JWT using firebase/php-jwt
  • Guard Http requests

Dependencies

  • [firebase/php-jwt] - A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to RFC 7519.
  • [php] - v5.6 +

Installation

Use Composer to install LumenJWT and its the dependencies.

$ composer require cvogit/LumenJWT
$ composer install

Configuration

In bootstrap/app.php enable the middleware:

$app->routeMiddleware([
    'jwt' => Cvogit\LumenJWT\Http\Middleware\JwtGuard::class,
]);

In .env

  • Create JWT_KEY and give it a random string.
  • Create JWT_EXP, set the time until the token expire in seconds, if not set the default is 7200 seconds.

Usage

Please visit the Wiki.

Todos

  • Add blacklist option

License

MIT