PHPackages                             ideationnet/jwt-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ideationnet/jwt-middleware

ActiveLibrary

ideationnet/jwt-middleware
==========================

PSR-15 compatible JWT Authentication middleware

04PHP

Since Nov 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ideationnet/jwt-middleware)[ Packagist](https://packagist.org/packages/ideationnet/jwt-middleware)[ RSS](/packages/ideationnet-jwt-middleware/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

JWT Middleware
==============

[](#jwt-middleware)

A simple PSR-15 compatible JWT authentication middleware.

Install
-------

[](#install)

Via Composer

```
$ composer require ideationnet/jwt-middleware
```

Usage
-----

[](#usage)

Use with your favourite PSR-15 middleware dispatcher, like [Stack Runner](https://github.com/ideationnet/stack-runner). Example configuration (using PHP-DI) where the options are changed to add `/token` as a public path:

```
return [
    JwtMiddleware::class => object()
        ->constructorParameter('options', ['public' => ['/token']]),
];
```

Options:

- `key` is the JWT secret key, defaults to `JWT_SECRET` environment variable
- `algorithms` is the array of supported algorithms, defaults to `['HS512']`
- `public` is an array of paths that bypass authentication
- `attribute` is the name of the attribute into which the decoded token is stored, defaults to `jwt-token`

The token is available in the `$request` object in middleware further down the stack:

```
$token = $request->getAttribute('jwt-token');

```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Darren Mothersele](http://www.darrenmothersele.com)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](License.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f0ce40e51bf1fb3ba86b4a566dbbb0a26e8792e1b9418228324e26e7450f42b?d=identicon)[darrenmothersele](/maintainers/darrenmothersele)

---

Top Contributors

[![darrenmothersele](https://avatars.githubusercontent.com/u/230337?v=4)](https://github.com/darrenmothersele "darrenmothersele (2 commits)")

### Embed Badge

![Health badge](/badges/ideationnet-jwt-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/ideationnet-jwt-middleware/health.svg)](https://phpackages.com/packages/ideationnet-jwt-middleware)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
