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

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

mostafakml/oauth2-server
========================

a fork from oauth2-server

7.0.0(8y ago)012MITPHPPHP &gt;=7.0.0

Since Aug 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mostafakml/oauth2-server)[ Packagist](https://packagist.org/packages/mostafakml/oauth2-server)[ Docs](https://oauth2.thephpleague.com/)[ RSS](/packages/mostafakml-oauth2-server/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (10)Versions (79)Used By (0)

PHP OAuth 2.0 Server
====================

[](#php-oauth-20-server)

[![Latest Version](https://camo.githubusercontent.com/07374488d628793eb4be22229129e52f084200d135bf3c5a010fc977e5332a36/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65616775652f6f61757468322d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/oauth2-server/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b916b61a090e82fbcc73f8435fe82b0852b3e73f675511abf0d9e8141bfadeee/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f6f61757468322d7365727665722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/oauth2-server)[![Coverage Status](https://camo.githubusercontent.com/4d19482eb9b0faee73dd2f8cab55c349f1eac3113f2cf4838a5e2630f9065c22/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f6f61757468322d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/oauth2-server/code-structure)[![Quality Score](https://camo.githubusercontent.com/5bbb71f2086c51eda336d8f4629178eb670b1c4058b39d07b9cda56125f95d5a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f6f61757468322d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/oauth2-server)[![Total Downloads](https://camo.githubusercontent.com/a78ed55a3198bcb7603d0635eeaa157c19cdd0b7561aed7e238fc35e9c51fa03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f6f61757468322d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/oauth2-server)[![PHPStan](https://camo.githubusercontent.com/a44af5fc39484990738cc4bd3874d884a42afdeed470b34a010e77bb8341ef31/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpstan/phpstan)

`league/oauth2-server` is a standards compliant implementation of an [OAuth 2.0](https://tools.ietf.org/html/rfc6749) authorization server written in PHP which makes working with OAuth 2.0 trivial. You can easily configure an OAuth 2.0 server to protect your API with access tokens, or allow clients to request new access tokens and refresh them.

Out of the box it supports the following grants:

- Authorization code grant
- Implicit grant
- Client credentials grant
- Resource owner password credentials grant
- Refresh grant

The following RFCs are implemented:

- [RFC6749 "OAuth 2.0"](https://tools.ietf.org/html/rfc6749)
- [RFC6750 " The OAuth 2.0 Authorization Framework: Bearer Token Usage"](https://tools.ietf.org/html/rfc6750)
- [RFC7519 "JSON Web Token (JWT)"](https://tools.ietf.org/html/rfc7519)
- [RFC7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://tools.ietf.org/html/rfc7636)

This library was created by Alex Bilbie. Find him on Twitter at [@alexbilbie](https://twitter.com/alexbilbie).

Requirements
------------

[](#requirements)

The following versions of PHP are supported:

- PHP 7.0
- PHP 7.1
- PHP 7.2

The `openssl` extension is also required.

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

[](#installation)

```
composer require league/oauth2-server

```

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

[](#documentation)

The library documentation can be found at . You can contribute to the documentation in the [gh-pages branch](https://github.com/thephpleague/oauth2-server/tree/gh-pages/).

Testing
-------

[](#testing)

The library uses [PHPUnit](https://phpunit.de/) for unit tests and [PHPStan](https://github.com/phpstan/phpstan) for static analysis of the code.

```
vendor/bin/phpunit
vendor/bin/phpstan analyse -l 6 -c phpstan.neon src tests

```

Continous Integration
---------------------

[](#continous-integration)

We use [Travis CI](https://travis-ci.org/), [Scrutinizer](https://scrutinizer-ci.com/), and [StyleCI](https://styleci.io/) for continuous integration. Check out [our](https://github.com/thephpleague/oauth2-server/blob/master/.travis.yml) [configuration](https://github.com/thephpleague/oauth2-server/blob/master/.scrutinizer.yml) [files](https://github.com/thephpleague/oauth2-server/blob/master/.styleci.yml) if you'd like to know more.

Community Integrations
----------------------

[](#community-integrations)

- [Laravel Passport](https://github.com/laravel/passport)
- [OAuth 2 Server for CakePHP 3](https://github.com/uafrica/oauth-server)

Changelog
---------

[](#changelog)

See the [project changelog](https://github.com/thephpleague/oauth2-server/blob/master/CHANGELOG.md)

Contributing
------------

[](#contributing)

Contributions are always welcome. Please see [CONTRIBUTING.md](https://github.com/thephpleague/oauth2-server/blob/master/CONTRIBUTING.md) and [CONDUCT.md](https://github.com/thephpleague/oauth2-server/blob/master/CONDUCT.md) for details.

Support
-------

[](#support)

Bugs and feature request are tracked on [GitHub](https://github.com/thephpleague/oauth2-server/issues).

If you have any questions about OAuth *please* open a ticket here; please **don't** email the address below.

Commercial Support
------------------

[](#commercial-support)

If you would like help implementing this library into your existing platform, or would be interested in OAuth advice or training for you and your team please get in touch with [Glynde Labs](https://glyndelabs.com).

Security
--------

[](#security)

If you discover any security related issues, please email `hello@alexbilbie.com` instead of using the issue tracker.

License
-------

[](#license)

This package is released under the MIT License. See the bundled [LICENSE](https://github.com/thephpleague/oauth2-server/blob/master/LICENSE) file for details.

Credits
-------

[](#credits)

This code is principally developed and maintained by [Andy Millington](https://twitter.com/Sephster) and [Simon Hamp](https://twitter.com/simonhamp).

Between 2012 and 2017 this library was developed and maintained by [Alex Bilbie](https://alexbilbie.com/).

PHP OAuth 2.0 Server is one of many packages provided by The PHP League. To find out more, please visit [our website](https://thephpleague.com).

Special thanks to [all of these awesome contributors](https://github.com/thephpleague/oauth2-server/contributors).

Additional thanks go to the [Mozilla Secure Open Source Fund](https://wiki.mozilla.org/MOSS/Secure_Open_Source) for funding a security audit of this library.

The initial code was developed as part of the [Linkey](http://linkey.blogs.lincoln.ac.uk) project which was funded by [JISC](http://jisc.ac.uk) under the Access and Identity Management programme.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 85.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 ~26 days

Recently: every ~20 days

Total

76

Last Release

3007d ago

Major Versions

4.1.6 → 5.1.22016-09-19

5.1.4 → 6.0.02017-07-01

5.1.5 → 6.0.12017-07-19

5.1.6 → 6.1.02017-12-23

6.1.1 → 7.0.02018-02-18

PHP version history (5 changes)0.2PHP &gt;=5.3.0

3.0PHP &gt;=5.4.0

5.0.0-RC1PHP &gt;=5.5.9

6.0.0PHP &gt;=5.6.0

7.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/84e2b1079ad36adcb4d1d00b3af922537657152dbfb4d0b1186248b6149bce98?d=identicon)[mostafakml](/maintainers/mostafakml)

---

Top Contributors

[![alexbilbie](https://avatars.githubusercontent.com/u/77991?v=4)](https://github.com/alexbilbie "alexbilbie (1691 commits)")[![Sephster](https://avatars.githubusercontent.com/u/1457058?v=4)](https://github.com/Sephster "Sephster (100 commits)")[![juliangut](https://avatars.githubusercontent.com/u/1104131?v=4)](https://github.com/juliangut "juliangut (56 commits)")[![dhrrgn](https://avatars.githubusercontent.com/u/149921?v=4)](https://github.com/dhrrgn "dhrrgn (11 commits)")[![erickjth](https://avatars.githubusercontent.com/u/287978?v=4)](https://github.com/erickjth "erickjth (11 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (10 commits)")[![lookyman](https://avatars.githubusercontent.com/u/3863468?v=4)](https://github.com/lookyman "lookyman (10 commits)")[![toopay](https://avatars.githubusercontent.com/u/534245?v=4)](https://github.com/toopay "toopay (7 commits)")[![mostafakml](https://avatars.githubusercontent.com/u/14137361?v=4)](https://github.com/mostafakml "mostafakml (6 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (6 commits)")[![Hywan](https://avatars.githubusercontent.com/u/946104?v=4)](https://github.com/Hywan "Hywan (6 commits)")[![michaelhogg](https://avatars.githubusercontent.com/u/6292810?v=4)](https://github.com/michaelhogg "michaelhogg (5 commits)")[![lucadegasperi](https://avatars.githubusercontent.com/u/820687?v=4)](https://github.com/lucadegasperi "lucadegasperi (5 commits)")[![MichaelGooden](https://avatars.githubusercontent.com/u/1275012?v=4)](https://github.com/MichaelGooden "MichaelGooden (5 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (4 commits)")[![cziegenberg](https://avatars.githubusercontent.com/u/1983424?v=4)](https://github.com/cziegenberg "cziegenberg (4 commits)")[![frederikbosch](https://avatars.githubusercontent.com/u/1552577?v=4)](https://github.com/frederikbosch "frederikbosch (4 commits)")[![lucasantarella](https://avatars.githubusercontent.com/u/1783707?v=4)](https://github.com/lucasantarella "lucasantarella (4 commits)")[![apollopy](https://avatars.githubusercontent.com/u/2421282?v=4)](https://github.com/apollopy "apollopy (3 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (3 commits)")

---

Tags

apiauthAuthenticationserveroauthoauth2authorizationoauth 2.0secureresourceprotectauthorisationoauth 2

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  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.6k136.0M248](/packages/league-oauth2-server)[chervand/yii2-oauth2-server

OAuth 2.0 server for Yii 2.0 with MAC tokens support.

1524.2k1](/packages/chervand-yii2-oauth2-server)[ezralazuardy/heimdall

Painless OAuth 2.0 Server for CodeIgniter 4

454.2k](/packages/ezralazuardy-heimdall)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)

PHPackages © 2026

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