diff --git a/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php b/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php index 52c2bd230c..85dde19e73 100644 --- a/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php +++ b/application/Espo/Core/ExternalAccount/Clients/OAuth2Abstract.php @@ -155,7 +155,7 @@ abstract class OAuth2Abstract implements IClient $code = $r['code']; } - if ($code == 200) { + if ($code >= 200 && $code < 300) { return $r['result']; } else { $handledData = $this->handleErrorResponse($r); diff --git a/application/Espo/Core/ExternalAccount/OAuth2/Client.php b/application/Espo/Core/ExternalAccount/OAuth2/Client.php index 530d362b1c..eae1c8162b 100644 --- a/application/Espo/Core/ExternalAccount/OAuth2/Client.php +++ b/application/Espo/Core/ExternalAccount/OAuth2/Client.php @@ -233,7 +233,7 @@ class Client $params['grant_type'] = $grantType; $httpHeaders = array(); - switch ($this->clientAuth) { + switch ($this->tokenType) { case self::AUTH_TYPE_URI: case self::AUTH_TYPE_FORM: $params['client_id'] = $this->clientId;