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

0.2.0-alpha(3mo ago)00MITPHP

Since Mar 26Pushed 3mo 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 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)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

32

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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 ~1411 days

Total

2

Last Release

97d ago

### Community

Maintainers

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

---

Top Contributors

[![cartertech](https://avatars.githubusercontent.com/u/7133057?v=4)](https://github.com/cartertech "cartertech (8 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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

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

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

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