cartertech/oauth2-deputy

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

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/cartertech/oauth2-deputy

0.2.0-alpha 2026-02-04 08:38 UTC

This package is auto-updated.

Last update: 2026-02-07 02:56:20 UTC


README

Latest Version Software License

This package provides Deputy OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

Usage

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

Authorization Code Flow

$provider = new Cartertech\OAuth2\Client\Provider\Deputy([
    'clientId'                => <your_client_id>,    // The client ID assigned to you by the provider
    'clientSecret'            => <your_client_secret>,    // 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".

To configure Deputy to allow OAuth authentication please refer to Deputy's documentation.

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

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

For further usage of this package please refer to the core package documentation on "Refreshing a Token".

Credits

License

The MIT License (MIT). Please see License File for more information.