Last active
July 2, 2018 13:49
-
-
Save mxr576/e894d454dbe1c31c812ca6db7c785670 to your computer and use it in GitHub Desktop.
Apigee PHP API client OAuth test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "vendor/autoload.php"; | |
require_once "examples/authentication.inc"; | |
$envCredProd = new EnvironmentCredentialProvider(); | |
$auth = new \Apigee\Edge\HttpClient\Plugin\Authentication\Oauth($envCredProd->getUsername(), $envCredProd->getPassword(), new \Apigee\Edge\Tests\Test\HttpClient\Plugin\InMemoryOauthTokenStorage(), null, getenv('APIGEE_EDGE_PHP_SDK_CLIENT_ID') ?: null, getenv('APIGEE_EDGE_PHP_SDK_CLIENT_SECRET' ?: null), null, getenv('APIGEE_EDGE_PHP_SDK_AUTH_SERVER') ?: null); | |
$client = new \Apigee\Edge\Client($auth); | |
$envc = new \Apigee\Edge\Api\Management\Controller\EnvironmentController($envCredProd->getOrganization(), $client); | |
try { | |
$list = $envc->getEntityIds(); | |
print_r($list); | |
} | |
catch (\Exception $e) { | |
print $e; | |
} | |
exit(0); |
Author
mxr576
commented
Jul 2, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment