compwright / oauth2-fieldedge
FieldEdge OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Fund package maintenance!
v2.0.0
2026-07-24 20:28 UTC
Requires
- php: ^8.3 || ^8.4 || ^8.5
- league/oauth2-client: ^2.5
- psr/http-message: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.89
- guzzlehttp/guzzle: ^7.15
- guzzlehttp/psr7: ^2.13
- league/oauth2-client: ^2.5
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.2
This package is auto-updated.
Last update: 2026-07-24 20:30:07 UTC
README
This package provides FieldEdge OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use composer:
composer require compwright/oauth2-fieldedge league/oauth2-client
Usage
Usage is the same as The League's OAuth client, using \Compwright\OAuth2\FieldEdge\ProviderFactory to create the provider instance.
Example: Client Credentials Flow
$provider = new Compwright\OAuth2\FieldEdge\ProviderFactory()->new( clientId: '{fieldedge-client-id}', clientSecret: '{fieldedge-client-secret}', ); // Get an access token $token = $provider->getAccessToken('client_credentials', ['target_id' => 'my_target_id']); // Use the token to interact with an API on the users behalf echo $token->getToken();
Example: Client Credentials Flow (Legacy Partner API)
$provider = new Compwright\OAuth2\FieldEdge\ProviderFactory()->newLegacy( clientId: '{fieldedge-client-id}', apiKey: '{fieldedge-api-key}', ); // Get an access token $token = $provider->getAccessToken('client_credentials'); // Use the token to interact with an API on the users behalf echo $token->getToken();
Testing
$ make test
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.