PHPackages                             maksimovic/oauth2-server-php - 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. maksimovic/oauth2-server-php

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

maksimovic/oauth2-server-php
============================

OAuth2 Server for PHP

v2.0.0(1mo ago)01.3k↑102.7%MITPHPPHP ^8.1CI passing

Since Oct 24Pushed 1mo agoCompare

[ Source](https://github.com/maksimovic/oauth2-server-php)[ Packagist](https://packagist.org/packages/maksimovic/oauth2-server-php)[ Docs](http://github.com/maksimovic/oauth2-server-php)[ RSS](/packages/maksimovic-oauth2-server-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (36)Used By (0)

### `maksimovic/oauth2-server-php`

[](#maksimovicoauth2-server-php)

[![Total Downloads](https://camo.githubusercontent.com/a04eca4c741d365e22f7c112b8f117949422ffe2359d18c97404acad18d24359/68747470733a2f2f706f7365722e707567782e6f72672f6d616b73696d6f7669632f6f61757468322d7365727665722d7068702f646f776e6c6f616473)](https://packagist.org/packages/maksimovic/oauth2-server-php)[![Latest Stable Version](https://camo.githubusercontent.com/ac263a26a04ed9ea1a63ae2bd6ddbe0f6887afbcee4e0a32f0eed93003e6e4d8/68747470733a2f2f706f7365722e707567782e6f72672f6d616b73696d6f7669632f6f61757468322d7365727665722d7068702f762f737461626c65)](https://packagist.org/packages/maksimovic/oauth2-server-php)

A maintained fork of [`bshaffer/oauth2-server-php`](https://github.com/bshaffer/oauth2-server-php) — a standards-compliant OAuth 2.0 and OpenID Connect server library for PHP. It provides the server side of grants (authorization code, client credentials, refresh token, JWT bearer, …), token / scope / user-credentials handling, and pluggable storage backends (PDO, Redis, MongoDB, DynamoDB, Cassandra, Couchbase, in-memory).

### Why this fork

[](#why-this-fork)

Upstream has been effectively dormant; open PRs sit for months without triage. This fork brings the library up to current tooling and picks up community fixes:

- **PHP 8.1–8.5** support
- **PHPUnit 10** test suite, **PHPStan** level-max static analysis
- Couchbase SDK 4.x, MongoDB SDK 2.x, DynamoDB null-safety, Cassandra driver refresh
- Dropped legacy Mongo driver
- Docker-based CI matrix across PHP 8.1–8.5 with all storage backends

### Drop-in replacement

[](#drop-in-replacement)

`composer.json` declares `"replace": {"bshaffer/oauth2-server-php": "*"}`, so any consumer still requiring `bshaffer/oauth2-server-php` can pull this fork without changing their constraint:

```
{
  "require": {
    "maksimovic/oauth2-server-php": "^2.0"
  }
}
```

### Documentation

[](#documentation)

The [upstream documentation](https://bshaffer.github.io/oauth2-server-php-docs/) still applies — public API and namespaces are unchanged.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance90

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 75.7% 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.

###  Release Activity

Cadence

Every ~164 days

Recently: every ~321 days

Total

31

Last Release

50d ago

Major Versions

v0.9 → v1.02013-08-12

v1.10.0 → v2.x-dev2017-11-30

v1.14.2 → v2.0.02026-04-20

PHP version history (5 changes)v0.1PHP &gt;=5.2.0

v1.2PHP &gt;=5.3.9

v1.12.0PHP &gt;=7.1

v1.14.1PHP &gt;=7.2

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d43e10a649dca578689bc02aa4089e26c0d26b1a2f3640dda458973e55adcf10?d=identicon)[maksimovic](/maintainers/maksimovic)

---

Top Contributors

[![bshaffer](https://avatars.githubusercontent.com/u/103941?v=4)](https://github.com/bshaffer "bshaffer (659 commits)")[![F21](https://avatars.githubusercontent.com/u/2263040?v=4)](https://github.com/F21 "F21 (75 commits)")[![bojanz](https://avatars.githubusercontent.com/u/330162?v=4)](https://github.com/bojanz "bojanz (39 commits)")[![fauguste](https://avatars.githubusercontent.com/u/2298302?v=4)](https://github.com/fauguste "fauguste (16 commits)")[![julien-c](https://avatars.githubusercontent.com/u/326577?v=4)](https://github.com/julien-c "julien-c (11 commits)")[![rjmackay](https://avatars.githubusercontent.com/u/7965?v=4)](https://github.com/rjmackay "rjmackay (6 commits)")[![trickleup](https://avatars.githubusercontent.com/u/3805828?v=4)](https://github.com/trickleup "trickleup (5 commits)")[![dsquier](https://avatars.githubusercontent.com/u/2637892?v=4)](https://github.com/dsquier "dsquier (5 commits)")[![adambutler](https://avatars.githubusercontent.com/u/1238468?v=4)](https://github.com/adambutler "adambutler (4 commits)")[![afilippov1985](https://avatars.githubusercontent.com/u/8296937?v=4)](https://github.com/afilippov1985 "afilippov1985 (4 commits)")[![stefanaxelsson](https://avatars.githubusercontent.com/u/529438?v=4)](https://github.com/stefanaxelsson "stefanaxelsson (4 commits)")[![tom-park](https://avatars.githubusercontent.com/u/3248113?v=4)](https://github.com/tom-park "tom-park (4 commits)")[![itskingori](https://avatars.githubusercontent.com/u/703786?v=4)](https://github.com/itskingori "itskingori (4 commits)")[![darrylkuhn](https://avatars.githubusercontent.com/u/3458313?v=4)](https://github.com/darrylkuhn "darrylkuhn (3 commits)")[![AdamZ](https://avatars.githubusercontent.com/u/109343?v=4)](https://github.com/AdamZ "AdamZ (3 commits)")[![phindmarsh](https://avatars.githubusercontent.com/u/344000?v=4)](https://github.com/phindmarsh "phindmarsh (3 commits)")[![javigs](https://avatars.githubusercontent.com/u/2932358?v=4)](https://github.com/javigs "javigs (2 commits)")[![Arul-](https://avatars.githubusercontent.com/u/2255137?v=4)](https://github.com/Arul- "Arul- (2 commits)")[![dallasvogels](https://avatars.githubusercontent.com/u/2522828?v=4)](https://github.com/dallasvogels "dallasvogels (2 commits)")[![daohoangson](https://avatars.githubusercontent.com/u/239336?v=4)](https://github.com/daohoangson "daohoangson (2 commits)")

---

Tags

authoauthoauth2

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maksimovic-oauth2-server-php/health.svg)

```
[![Health](https://phpackages.com/badges/maksimovic-oauth2-server-php/health.svg)](https://phpackages.com/packages/maksimovic-oauth2-server-php)
```

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k143.0M269](/packages/league-oauth2-server)[bshaffer/oauth2-server-php

OAuth2 Server for PHP

3.3k15.8M112](/packages/bshaffer-oauth2-server-php)[league/openid-connect-claims

An OpenID Connect ID claims set implementation

16254.4k3](/packages/league-openid-connect-claims)[chervand/yii2-oauth2-server

OAuth 2.0 server for Yii 2.0 with MAC tokens support.

1524.5k1](/packages/chervand-yii2-oauth2-server)

PHPackages © 2026

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