mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
29 lines
859 B
PHP
29 lines
859 B
PHP
<?php
|
|
|
|
namespace Combodo\iTop\Core\Authentication\Client\OAuth;
|
|
|
|
use TheNetworg\OAuth2\Client\Provider\Azure;
|
|
|
|
class OAuthClientProviderAzure extends OAuthClientProviderAbstract
|
|
{
|
|
/** @var string */
|
|
protected static $sVendorName = 'Azure';
|
|
|
|
public function __construct($oOAuthClient, array $collaborators = [])
|
|
{
|
|
parent::__construct($oOAuthClient);
|
|
|
|
$aOptions = [
|
|
'prompt' => 'consent',
|
|
'scope' => 'offline_access',
|
|
'defaultEndPointVersion' => Azure::ENDPOINT_VERSION_2_0,
|
|
'clientId' => $oOAuthClient->Get('client_id'),
|
|
'clientSecret' => $oOAuthClient->Get('client_secret'),
|
|
'redirectUri' => $oOAuthClient->Get('redirect_url'),
|
|
'tenant' => $oOAuthClient->Get('tenant'),
|
|
];
|
|
|
|
$this->oVendorProvider = new Azure($aOptions, $collaborators);
|
|
}
|
|
}
|