IAMClient¶
Client for the IAM service API
```php
// 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 <code>Authorization</code> Header.
```php
$http->get(
$url,
['headers' => [
'Authorization' => $token->getAuthorizationHeader()
]]);
```
« More »