Files
iTop/sources/Core/Authentication/Client/OAuth/OAuthClientProviderAzure.php

35 lines
1.3 KiB
PHP

<?php
namespace Combodo\iTop\Core\Authentication\Client\OAuth;
use TheNetworg\OAuth2\Client\Provider\Azure;
class OAuthClientProviderAzure extends OAuthClientProviderAbstract
{
// /** @var string */
// static protected $sVendorName = 'Azure';
// /** @var array */
// static protected $sVendorColors = ['#0766b7', '#0d396b', '#2893df', '#3ccbf4'];
// /** @var string */
// static protected $sVendorIcon = '../images/icons/icons8-azure.svg';
// static protected $sRequiredSMTPScope = 'https://outlook.office.com/SMTP.Send offline_access';
// static protected $sRequiredIMAPScope = 'https://outlook.office.com/IMAP.AccessAsUser.All offline_access';
// static protected $sRequiredPOPScope = 'https://outlook.office.com/POP.AccessAsUser.All offline access';
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'),
];
$this->oVendorProvider = new Azure($aOptions, $collaborators);
}
}