PHPackages                             mezzio/mezzio-authentication-oauth2 - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. mezzio/mezzio-authentication-oauth2

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mezzio/mezzio-authentication-oauth2
===================================

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

3.0.0(1mo ago)28483.0k—6.1%19[3 PRs](https://github.com/mezzio/mezzio-authentication-oauth2/pulls)2BSD-3-ClausePHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Dec 31Pushed 1mo ago15 watchersCompare

[ Source](https://github.com/mezzio/mezzio-authentication-oauth2)[ Packagist](https://packagist.org/packages/mezzio/mezzio-authentication-oauth2)[ Docs](https://mezzio.dev)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/mezzio-mezzio-authentication-oauth2/feed)WikiDiscussions 2.15.x Synced 1mo ago

READMEChangelog (10)Dependencies (26)Versions (69)Used By (2)

OAuth2 server middleware for Mezzio and PSR-7 applications
==========================================================

[](#oauth2-server-middleware-for-mezzio-and-psr-7-applications)

[![Build Status](https://github.com/mezzio/mezzio-authentication-oauth2/workflows/Continuous%20Integration/badge.svg)](https://github.com/mezzio/mezzio-authentication-oauth2/actions?query=workflow%3A%22Continuous+Integration%22)

> ## 🇷🇺 Русским гражданам
>
> [](#-русским-гражданам)
>
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
>
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
>
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
>
> ## 🇺🇸 To Citizens of Russia
>
> [](#-to-citizens-of-russia)
>
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
>
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
>
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

Laminas-mezzio-authentication-oauth2 is middleware for [Mezzio](https://github.com/mezzio/mezzio)and [PSR-7](http://www.php-fig.org/psr/psr-7/) applications providing an OAuth2 server for authentication.

This library uses the [league/oauth2-server](https://oauth2.thephpleague.com/)package for implementing the OAuth2 server. It supports all the following grant types:

- client credentials;
- password;
- authorization code;
- implicit;
- refresh token;

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

[](#installation)

You can install the *mezzio-authentication-oauth2* library with composer:

```
$ composer require mezzio/mezzio-authentication-oauth2
```

Documentation
-------------

[](#documentation)

Browse the documentation online at

Support
-------

[](#support)

- [Issues](https://github.com/mezzio/mezzio-authentication-oauth2/issues/)
- [Chat](https://laminas.dev/chat/)
- [Forum](https://discourse.laminas.dev/)

###  Health Score

69

—

FairBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~13 days

Total

64

Last Release

55d ago

Major Versions

0.4.3 → 1.0.02019-12-31

1.3.0 → 2.0.02019-12-31

1.3.1 → 2.0.12020-02-10

1.3.2 → 2.0.22020-03-28

2.15.x-dev → 3.1.x-dev2026-03-24

PHP version history (7 changes)0.1.0PHP ^7.1

2.1.0PHP ^7.3 || ~8.0.0

2.2.0PHP ^7.4 || ~8.0.0 || ~8.1.0

2.6.x-devPHP ~8.0.0 || ~8.1.0 || ~8.2.0

2.8.x-devPHP ~8.1.0 || ~8.2.0 || ~8.3.0

2.11.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

2.13.x-devPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25943?v=4)[Matthew Weier O'Phinney](/maintainers/weierophinney)[@weierophinney](https://github.com/weierophinney)

![](https://avatars.githubusercontent.com/u/296074?v=4)[Zend Framework](/maintainers/zendframework)[@zendframework](https://github.com/zendframework)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (110 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (96 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (94 commits)")[![ezimuel](https://avatars.githubusercontent.com/u/475967?v=4)](https://github.com/ezimuel "ezimuel (47 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (33 commits)")[![geerteltink](https://avatars.githubusercontent.com/u/9497586?v=4)](https://github.com/geerteltink "geerteltink (18 commits)")[![wshafer](https://avatars.githubusercontent.com/u/1828455?v=4)](https://github.com/wshafer "wshafer (17 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (16 commits)")[![tux-rampage](https://avatars.githubusercontent.com/u/558326?v=4)](https://github.com/tux-rampage "tux-rampage (13 commits)")[![marcguyer](https://avatars.githubusercontent.com/u/35496?v=4)](https://github.com/marcguyer "marcguyer (12 commits)")[![arueckauer](https://avatars.githubusercontent.com/u/1815979?v=4)](https://github.com/arueckauer "arueckauer (12 commits)")[![thexpand](https://avatars.githubusercontent.com/u/14979167?v=4)](https://github.com/thexpand "thexpand (8 commits)")[![jguittard](https://avatars.githubusercontent.com/u/5320213?v=4)](https://github.com/jguittard "jguittard (8 commits)")[![cvigorsICBF](https://avatars.githubusercontent.com/u/70528846?v=4)](https://github.com/cvigorsICBF "cvigorsICBF (6 commits)")[![Xerkus](https://avatars.githubusercontent.com/u/725842?v=4)](https://github.com/Xerkus "Xerkus (5 commits)")[![froschdesign](https://avatars.githubusercontent.com/u/103362?v=4)](https://github.com/froschdesign "froschdesign (5 commits)")[![laminas-bot](https://avatars.githubusercontent.com/u/68250880?v=4)](https://github.com/laminas-bot "laminas-bot (5 commits)")[![lcobucci](https://avatars.githubusercontent.com/u/201963?v=4)](https://github.com/lcobucci "lcobucci (5 commits)")[![tobias-trozowski](https://avatars.githubusercontent.com/u/3001979?v=4)](https://github.com/tobias-trozowski "tobias-trozowski (5 commits)")[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (4 commits)")

---

Tags

authenticationauthentication-middlewareoauth2httppsr-7middlewarelaminasAuthenticationoauth2mezzio

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mezzio-mezzio-authentication-oauth2/health.svg)

```
[![Health](https://phpackages.com/badges/mezzio-mezzio-authentication-oauth2/health.svg)](https://phpackages.com/packages/mezzio-mezzio-authentication-oauth2)
```

###  Alternatives

[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.0M61](/packages/mezzio-mezzio-router)[mezzio/mezzio-helpers

Helper/Utility classes for Mezzio

134.3M67](/packages/mezzio-mezzio-helpers)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

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