Client for the IAM service API
// Get AccessToken by IAM
<?php
use NextEvent\PHPSDK\Client;
use NextEvent\PHPSDK\Auth\IAMClient;
$credentials = ['user', 'password', 'scope']; // Your Credentials
$client = new Client($appUrl, $credentials, $widgetHash);
// stand alone
$iam_client = new IAMClient($credentials, $cache);
$token = $iam_client->getToken();
With the Token you can authorize requests to the NextEvent application by
setting the Authorization
Header.
$http->get(
$url,
['headers' => [
'Authorization' => $token->getAuthorizationHeader()
]]);
package |
NextEvent\PHPSDK\Service |
---|
__construct(array $credentials, \NextEvent\PHPSDK\Store\StoreInterface $cache, \Psr\Log\LoggerInterface $logger)
array
\Psr\Log\LoggerInterface
getNewToken() : \NextEvent\PHPSDK\Model\Token|null
getToken() : \NextEvent\PHPSDK\Model\Token|null
setCache(\NextEvent\PHPSDK\Store\StoreInterface $cache)
Throws |
|
---|
IAM_TOKEN_KEY