iqnection-programming / teamwork-oauth2
OAuth2 Provider for the PHP League OAuth2 Client package
1.0.0
2021-11-19 20:46 UTC
Requires
- league/oauth2-client: ^2.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-12-20 03:18:42 UTC
README
This package provides a Teamwork OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use composer:
composer require iqnection-programming/teamwork-oauth2
Usage
View examples in the example directory
Authorization Code Flow
$provider = new \IQnectionProgramming\TeamworkOAuth2\Provider\Teamwork([ 'clientId' => 'my-client-id', 'clientSecret' => 'my-client-secret', 'redirectUri' => 'https://example.com/my-redirect-uri' ]);
For further usage of this package please refer to the core package documentation on "Authorization Code Grant".
Using your token
$tokenData = []; <-- Retrieve your token data from your data store
$token = new \League\OAuth2\Client\Token\AccessToken($tokenData);
$values = $token->getValues();
$tokenString = $token->getToken());
$apuUrl = $values['installation']['apiEndPoint'];
Testing
$ ./vendor/bin/phpunit
License
The MIT License (MIT). Please see License File for more information.