Answer the question
In order to leave comments, you need to log in
Bitrix24 box - OAuth authorization error, where to dig?
There is a Bitrix24 box installed on BitrixEnv.
When trying to install an application, for example Wazzup or exchange with 1C, when authorizing the application, it returns an error
NO_AUTH_DATA
Wrong authorization data
Where to dig?
Answer the question
In order to leave comments, you need to log in
In general, I managed to get to the bottom of the problem with a debugger, maybe someone will come in handy.
A couple of facts. Bitrix has a modular structure. Bitrix has a REST API module.
When you install a module, you can register event handlers. When installed, in this case REST Api, registers handlers for different authorization options
if(!\Bitrix\Main\ModuleManager::isModuleInstalled("oauth"))
{
$eventManager->registerEventHandler("rest", "onRestCheckAuth", "rest", "\\Bitrix\\Rest\\OAuth\\Auth", "onRestCheckAuth");
}
$eventManager->registerEventHandler("rest", "onRestCheckAuth", "rest", "\\Bitrix\\Rest\\APAuth\\Auth", "onRestCheckAuth");
$eventManager->registerEventHandler("rest", "onRestCheckAuth", "rest", "\\Bitrix\\Rest\\SessionAuth\\Auth", "onRestCheckAuth");
foreach(GetModuleEvents('rest', 'OnRestCheckAuth', true) as $eventHandler)
{
$eventResult = ExecuteModuleEventEx($eventHandler, array($query, $scope, &$res));
if($eventResult !== null)
{
return $eventResult;
}
}
if(!\Bitrix\Main\ModuleManager::isModuleInstalled("oauth"))
{
$eventManager->registerEventHandler("rest", "onRestCheckAuth", "rest", "\\Bitrix\\Rest\\OAuth\\Auth", "onRestCheckAuth");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question