Files
api/services/nginx/app/classes/entra.php
T
Jepp9350 543a02c8e6 Update dependencies in composer.lock
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.
2025-05-21 15:07:04 +02:00

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()
);
}
}