Upgraded multiple dependencies to their latest versions to ensure compatibility, address bug fixes, and incorporate new features. Notable updates include `aws/aws-sdk-php`, `guzzlehttp/guzzle`, `illuminate/*`, and several others.
39 lines
888 B
PHP
39 lines
888 B
PHP
<?php
|
|
|
|
namespace classes;
|
|
|
|
require_once WD . '/modules/entra/entra_c.php';
|
|
|
|
use entra\entra_c;
|
|
use Microsoft\Graph\GraphServiceClient;
|
|
use Microsoft\Kiota\Authentication\Oauth\ClientCredentialContext;
|
|
|
|
class entra
|
|
{
|
|
/**
|
|
* Configuration of the Entra module
|
|
* @var entra_c
|
|
*/
|
|
public entra_c $config;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->config = new entra_c();
|
|
}
|
|
|
|
public function getGraphClient(): GraphServiceClient
|
|
{
|
|
return new GraphServiceClient(
|
|
$this->getTokenRequestContext(),
|
|
);
|
|
}
|
|
|
|
public function getTokenRequestContext(): ClientCredentialContext
|
|
{
|
|
return new ClientCredentialContext(
|
|
$this->config->tenant_id->getVariableValue(),
|
|
$this->config->client_id->getVariableValue(),
|
|
$this->config->client_secret->getVariableValue()
|
|
);
|
|
}
|
|
} |