PHPackages                             jwilsson/oauth2-client - 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. jwilsson/oauth2-client

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

jwilsson/oauth2-client
======================

A modern OAuth2 Client Library.

4.0.0(2y ago)55371MITPHPPHP ^8.2

Since Jun 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/jwilsson/php-oauth2-client)[ Packagist](https://packagist.org/packages/jwilsson/oauth2-client)[ RSS](/packages/jwilsson-oauth2-client/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (11)Used By (1)

PHP OAuth2 Client Library
=========================

[](#php-oauth2-client-library)

[![Packagist](https://camo.githubusercontent.com/0855e9aa29f818a11f4a0ec09682b56f5114d4cb01f57c5e02640966adbcc63f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a77696c73736f6e2f6f61757468322d636c69656e742e737667)](https://packagist.org/packages/jwilsson/oauth2-client)[![build](https://github.com/jwilsson/php-oauth2-client/workflows/build/badge.svg)](https://github.com/jwilsson/php-oauth2-client/workflows/build/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/b921786b7706035007b8f071b3cf1746932a5544f23192a9784b816b27fc5a6e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6a77696c73736f6e2f7068702d6f61757468322d636c69656e742f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/r/jwilsson/php-oauth2-client?branch=main)

Features
--------

[](#features)

- Fully supports modern OAuth2 grant types:
    - Authorization Code
    - Client Credentials
    - Proof Key for Code Exchange (PKCE)
    - Refresh Token
- Full utilization of PSR-7, PSR-17, and PSR-18.
- Compatible with PSR-4 autoloading.

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

[](#requirements)

- PHP 8.4 or later.
- A [PSR-18 HTTP client](https://packagist.org/providers/php-http/client-implementation).
- A [PSR-7 implementation](https://packagist.org/providers/psr/http-message-implementation).

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

[](#installation)

Via Composer:

```
composer require jwilsson/oauth2-client
```

Usage
-----

[](#usage)

See the [`docs`](docs/) folder for complete usage information.

Related
-------

[](#related)

- [AutoRefreshOAuth2TokenPlugin](https://github.com/jwilsson/php-auto-refresh-oauth2-token-plugin) - A HTTPlug plugin to automatically refresh expired OAuth2 access tokens.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance49

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~140 days

Recently: every ~257 days

Total

10

Last Release

892d ago

Major Versions

1.1.2 → 2.0.02021-02-06

2.1.1 → 3.0.02022-12-12

3.0.0 → 4.0.02023-12-02

PHP version history (5 changes)1.0.0PHP ^7.4

1.1.1PHP ^7.4 || ^8.0

2.0.0PHP ^8.0

3.0.0PHP ^8.1

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9833a6d6357b253e3e034c4cc407b76aa3205447eda63b2a77d398fecfd9b841?d=identicon)[jwilsson](/maintainers/jwilsson)

---

Top Contributors

[![jwilsson](https://avatars.githubusercontent.com/u/567607?v=4)](https://github.com/jwilsson "jwilsson (53 commits)")

---

Tags

oauth2oauth2-clientphp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jwilsson-oauth2-client/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[j0k3r/graby

Graby helps you extract article content from web pages

384349.6k2](/packages/j0k3r-graby)[florianv/exchanger

Currency exchange rates framework for PHP

1874.7M15](/packages/florianv-exchanger)[happyr/linkedin-api-client

LinkedIn API client. Handles OAuth, CSRF protection. Easy to implement and extend. This is a standalone library for any composer project.

1991.6M12](/packages/happyr-linkedin-api-client)[dhope0000/lxd

PHP-based API wrapper for LXD REST API.

136.2k](/packages/dhope0000-lxd)

PHPackages © 2026

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