This is a reference implementation of jimtools/jwt-auth
with Slim Skeleton.
cp .env.example .env
composer install
composer start
- All routes are protected apart from
/auth/login
, this will return a JWT to set in the requestAuthorization
header/auth/me
will display the JWT claims
- See dependencies.php for basic setup in the container
- It is registered by default in middleware.php
- See HttpErrorHandler.php:62 for authentication error handling.
For more information please read the documentation for jwt-auth and Slim Framework
Please note while this reference implementation uses Slim, the middleware is PSR-15 compliant and can be used with any framework that supports PSR-15 middleware such as Mezzio.