mirror of https://github.com/MISP/MISP
commit
1004f2a4b9
|
@ -214,7 +214,7 @@ class AadAuthenticateAuthenticate extends BaseAuthenticate
|
|||
];
|
||||
$url = self::$auth_provider . self::$ad_tenant . "/oauth2/v2.0/token";
|
||||
|
||||
$response = (new HttpSocket())->post($url, $params, $options);
|
||||
$response = ($this->_createHttpSocket())->post($url, $params, $options);
|
||||
|
||||
if (!$response->isOk()) {
|
||||
$this->_log("warning", "Error received during Bearer token fetch (context).");
|
||||
|
@ -239,7 +239,7 @@ class AadAuthenticateAuthenticate extends BaseAuthenticate
|
|||
];
|
||||
$url = self::$auth_provider_user . "/v1.0/me";
|
||||
|
||||
$response = (new HttpSocket())->get($url, null, $options);
|
||||
$response = ($this->_createHttpSocket())->get($url, null, $options);
|
||||
|
||||
if (!$response->isOk()) {
|
||||
$this->_log("warning", "Error received during user data fetch.");
|
||||
|
@ -307,7 +307,7 @@ class AadAuthenticateAuthenticate extends BaseAuthenticate
|
|||
$has_next_page = true;
|
||||
$url = self::$auth_provider_user . "/v1.0/me/memberOf";
|
||||
while ($has_next_page) {
|
||||
$response = (new HttpSocket())->get($url, array(), $options);
|
||||
$response = ($this->_createHttpSocket())->get($url, array(), $options);
|
||||
|
||||
if (!$response->isOk()) {
|
||||
$this->_log("warning", "Error received during user group data fetch.");
|
||||
|
@ -346,4 +346,20 @@ class AadAuthenticateAuthenticate extends BaseAuthenticate
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HttpSocket with proxy settings
|
||||
*
|
||||
* @return HttpSocket
|
||||
*/
|
||||
private function _createHttpSocket()
|
||||
{
|
||||
$httpSocket = new HttpSocket();
|
||||
$proxy = Configure::read('Proxy');
|
||||
if (isset($proxy['host']) && !empty($proxy['host'])) {
|
||||
$httpSocket->configProxy($proxy['host'], $proxy['port'], $proxy['method'], $proxy['user'], $proxy['password']);
|
||||
}
|
||||
|
||||
return $httpSocket;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue