mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°3169 - Add feature to connect Gsuite mail box with OAuth
N°2504 - Add feature to connect Office mail box with OAuth2 for Microsoft Graph N°5102 - Allow to send emails (eg. notifications) using GSuite SMTP and OAuth * 2.7 migration (wip)
This commit is contained in:
26
sources/Controller/OAuth/OAuthAjaxController.php
Normal file
26
sources/Controller/OAuth/OAuthAjaxController.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Controller\OAuth;
|
||||
|
||||
use Combodo\iTop\Application\TwigBase\Controller\Controller;
|
||||
use Combodo\iTop\Core\Authentication\Client\OAuth\OAuthClientProviderFactory;
|
||||
use utils;
|
||||
|
||||
class OAuthAjaxController extends Controller
|
||||
{
|
||||
public function OperationGetAuthorizationUrl()
|
||||
{
|
||||
$aResult = ['status' => 'success', 'data' => []];
|
||||
$sProvider = utils::ReadParam('provider', '', false, 'raw');
|
||||
$sClientId = utils::ReadParam('client_id', '', false, 'raw');
|
||||
$sClientSecret = utils::ReadParam('client_secret', '', false, 'raw');
|
||||
$sScope = utils::ReadParam('scope', '', false, 'raw');
|
||||
$sAdditional = utils::ReadParam('additional', '', false, 'raw');
|
||||
$aAdditional = [];
|
||||
parse_str($sAdditional, $aAdditional);
|
||||
$sAuthorizationUrl = OAuthClientProviderFactory::getVendorProviderForAccessUrl($sProvider, $sClientId, $sClientSecret, $sScope, $aAdditional);
|
||||
$aResult['data']['authorization_url'] = $sAuthorizationUrl;
|
||||
|
||||
$this->DisplayJSONPage($aResult);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user