This package provides Domo OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
To install, use composer:
composer require compwright/oauth2-domo
Usage is the same as The League's OAuth client, using \Compwright\OAuth2\Domo\DomoProvider
as the provider.
$domoProviderFactory = new DomoProviderFactory();
$provider = $domoProviderFactory->new(
clientId: 'your_client_id',
clientSecret: 'your_client_secret',
);
$token = $provider->getAccessToken('client_credentials', [
'scope' => ['data', 'user'],
]);
echo $token->getToken() . PHP_EOL;
// requires 'user' scope
$user = $provider->getResourceOwner($token);
echo $user->getId() . PHP_EOL;
echo $user->getName() . PHP_EOL;
echo $user->getEmail() . PHP_EOL;
$ make test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.