Skip to content

EspoCRM – Open Source CRM Application

oauth client support lowercase token type

Yuri Kuznetsov3b88dfb7c7f3
diff --git a/application/Espo/Core/ExternalAccount/OAuth2/Client.php b/application/Espo/Core/ExternalAccount/OAuth2/Client.php
index 15e4531648..ffdefdc479 100644
--- a/application/Espo/Core/ExternalAccount/OAuth2/Client.php
+++ b/application/Espo/Core/ExternalAccount/OAuth2/Client.php
@@ -175,6 +175,20 @@ class Client
*/
public function setTokenType($tokenType)
{
+ $lower = strtolower($tokenType);
+
+ if ($lower === 'bearer') {
+ $tokenType = self::TOKEN_TYPE_BEARER;
+ }
+
+ if ($lower === 'uri') {
+ $tokenType = self::TOKEN_TYPE_URI;
+ }
+
+ if ($lower === 'oauth') {
+ $tokenType = self::TOKEN_TYPE_OAUTH;
+ }
+
$this->tokenType = $tokenType;
}