PHPackages                             aist/authorization-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. aist/authorization-middleware

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

aist/authorization-middleware
=============================

PSR-7 Authorization Middleware

022PHP

Since Aug 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ma-si/authorization-middleware)[ Packagist](https://packagist.org/packages/aist/authorization-middleware)[ RSS](/packages/aist-authorization-middleware/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Aist Authorization Middleware [![SensioLabsInsight](https://camo.githubusercontent.com/448847ca63b5a5165674933d0636b31a1891a5391f7732acf60020e899267f64/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65393361636133612d626363612d343032392d383063652d6538373362376465396236622f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/e93aca3a-bcca-4029-80ce-e873b7de9b6b)
====================================================================================================================================================================================================================================================================================================================================================================================================================

[](#aist-authorization-middleware-)

[![Build status](https://camo.githubusercontent.com/fb048cea846049d159423875ac7453041098bea62b9b014cb1ec5e49e3fe34ff/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d612d73692f617574686f72697a6174696f6e2d6d6964646c65776172652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://secure.travis-ci.org/ma-si/authorization-middleware)[![Coverage Status](https://camo.githubusercontent.com/1ff83089b792187dbdccafdc975bb420f9f419eab6c24565862dfc01843a34bf/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6d612d73692f617574686f72697a6174696f6e2d6d6964646c65776172652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/ma-si/authorization-middleware?branch=master)[![Code Climate](https://camo.githubusercontent.com/6c575567fe617e540487cf6806346fcd28af7e3aa517ebd2192ee6b5a777922f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f6d612d73692f617574686f72697a6174696f6e2d6d6964646c65776172652e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/ma-si/authorization-middleware)[![Sensio](https://camo.githubusercontent.com/854853f0e6ab3359c8f61435b538b478ec56f3faff290f3523e53563775094f4/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f65393361636133612d626363612d343032392d383063652d6538373362376465396236622e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/e93aca3a-bcca-4029-80ce-e873b7de9b6b)[![Packagist](https://camo.githubusercontent.com/170702b650916434bb505c43e51cd72c9151132e80d486d58395fc1032e26cd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616973742f617574686f72697a6174696f6e2d6d6964646c65776172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aist/authorization-middleware)

[![License](https://camo.githubusercontent.com/5a8976e3a8e58fc79e9fc8be5869940db8fe07ee7e0cc21cbe836be9af21924f/68747470733a2f2f706f7365722e707567782e6f72672f616973742f617574686f72697a6174696f6e2d6d6964646c65776172652f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://opensource.org/licenses/BSD-3-Clause)

*PSR-7 Authorization Middleware.*

Installation
------------

[](#installation)

Install via composer:

```
$ composer require aist/authorization-middleware
```

Configuration
-------------

[](#configuration)

Add pipe to protect whole app

```
// Add more middleware here that needs to introspect the routing results; this
// might include:
//
// - route-based authentication
// - route-based validation
// - etc.

// Authentication middleware
$app->pipe(\Aist\AuthenticationMiddleware\Middleware\AuthenticationMiddleware::class);

// Authorization middleware
// At this point, if no identity is set by authorization middleware, the
// UnauthorizedHandler kicks in; alternately, you can provide other fallback
// middleware to execute.
//$app->pipe(\Aist\AuthorizationMiddleware\Middleware\UnauthorizedHandler::class);
// Authorization
$app->pipe(\Aist\AuthorizationMiddleware\Middleware\AuthorizationMiddleware::class);

```

or use for specific route

```
$app->get(
    '/',
    [
        \Aist\AuthenticationMiddleware\Middleware\AuthenticationMiddleware::class,
        \Aist\AuthorizationMiddleware\Middleware\AuthorizationMiddleware::class,
        App\Action\DashboardAction::class,
    ],
    'dashboard'
);

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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/42b693076307a5fa17b0df69ee058c3f95482bd01e93f3d17a27137d6fdf1c17?d=identicon)[aist](/maintainers/aist)

---

Top Contributors

[![ma-si](https://avatars.githubusercontent.com/u/1869327?v=4)](https://github.com/ma-si "ma-si (2 commits)")

### Embed Badge

![Health badge](/badges/aist-authorization-middleware/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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