PHPackages                             cartertech/oauth2-deputy - 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. cartertech/oauth2-deputy

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

cartertech/oauth2-deputy
========================

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

v1.0.0(1mo ago)02MITPHP

Since Mar 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/cartertech/oauth2-deputy)[ Packagist](https://packagist.org/packages/cartertech/oauth2-deputy)[ RSS](/packages/cartertech-oauth2-deputy/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Deputy Provider for OAuth 2.0 Client
====================================

[](#deputy-provider-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/0153c635e19ec3dea36eb778039d8e4bfe6010cbc2657b25578dbca164474244/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636172746572746563682f6f61757468322d6465707574792e7376673f7374796c653d666c61742d737175617265)](https://github.com/cartertech/oauth2-deputy/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package provides Deputy OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Usage
-----

[](#usage)

Usage is similar to The League's OAuth client, using `\Cartertech\OAuth2\Client\Provider\Deputy` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Cartertech\OAuth2\Client\Provider\Deputy([
    'clientId'                => ,    // The client ID assigned to you by the provider
    'clientSecret'            => ,    // The client password assigned to you by the provider
    'redirectUri'             => 'https://example.com/callback.php,
    'urlAuthorize'            => 'https://once.deputy.com/my/oauth/login',
    'urlAccessToken'          => 'https://once.deputy.com/my/oauth/access_token'
]);
```

For further usage of this package please refer to the [core package documentation on "Authorization Code Grant"](https://github.com/thephpleague/oauth2-client#usage).

To configure Deputy to allow OAuth authentication please refer to [Deputy's documentation](https://developer.deputy.com/docs/using-oauth-20).

### Refreshing a Token

[](#refreshing-a-token)

```
$existingAccessToken = getAccessTokenFromYourDataStore();

if ($existingAccessToken->hasExpired()) {
    $newAccessToken = $provider->getAccessToken('refresh_token', [
        'refresh_token' => $existingAccessToken->getRefreshToken()
    ]);

    // Purge old access token and store new access token to your data store.
}
```

### Storing the endpoint URL for the Provider's use

[](#storing-the-endpoint-url-for-the-providers-use)

```
$provider->setDomain($accessToken->getEndpointUrl());
```

For further usage of this package please refer to the [core package documentation on "Refreshing a Token"](https://github.com/thephpleague/oauth2-client#refreshing-a-token).

Credits
-------

[](#credits)

- [Carter Tech Pty Ltd](https://github.com/cartertech)
- [All Contributors](https://github.com/cartertech/oauth2-deputy/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/cartertech/oauth2-deputy/blob/master/LICENSE) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance93

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Every ~762 days

Total

3

Last Release

37d ago

Major Versions

0.2.0-alpha → v1.0.02026-05-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7133057?v=4)[Nathan Carter](/maintainers/cartertech)[@cartertech](https://github.com/cartertech)

---

Top Contributors

[![cartertech](https://avatars.githubusercontent.com/u/7133057?v=4)](https://github.com/cartertech "cartertech (10 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationdeputydeputy-api

### Embed Badge

![Health badge](/badges/cartertech-oauth2-deputy/health.svg)

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

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

25310.7M82](/packages/thenetworg-oauth2-azure)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1152.8M12](/packages/patrickbussmann-oauth2-apple)[omines/oauth2-gitlab

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

36779.2k16](/packages/omines-oauth2-gitlab)[league/oauth2-instagram

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

661.1M48](/packages/league-oauth2-instagram)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

261.8M1](/packages/mollie-oauth2-mollie-php)

PHPackages © 2026

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