28 $externalAuthId =
$USER->GetParam(
'EXTERNAL_AUTH_ID');
30 if (
$USER->IsAdmin() || $externalAuthId ===
"__controller")
36 $blackList = UserTable::getExternalUserTypes();
37 if (in_array($externalAuthId, $blackList,
true))
42 if (!\
Bitrix\
Main\Loader::includeModule(
'intranet'))
47 if (\
Bitrix\Intranet\Util::isIntranetUser())
52 if (\
Bitrix\Intranet\Util::isExtranetUser())
65 foreach(static::$authQueryParams as
$key)
74 if($authKey !==
null || Context::getCurrent()->getRequest()->getHeader(
'X-Bitrix-Csrf-Token') !==
null)
76 static::checkHttpAuth();
77 static::checkCookieAuth();
79 if(!
$USER->isAuthorized())
82 $res =
array(
'error' =>
'access_denied',
'error_description' =>
'User not authorized',
'additional' =>
array(
'sessid' =>
bitrix_sessid(),
'extended_error' =>
'user_not_authorized'));
86 if (self::isAccessAllowed())
90 'user_id' =>
$USER->GetID(),
91 'scope' => implode(
',', \CRestUtil::getScopeList()),
92 'parameters_clear' => static::$authQueryParams,
93 'auth_type' => static::AUTH_TYPE,
98 if (
$query[
'BX_SESSION_LOCK'] ??
null !==
'Y')
100 session_write_close();
106 $res =
array(
'error' =>
'access_denied',
'error_description' =>
'Access denied for this type of user',
'additional' =>
array(
'type' =>
$USER->GetParam(
'EXTERNAL_AUTH_ID')));
112 $res =
array(
'error' =>
'session_failed',
'error_description' =>
'Sessid check failed',
'additional' =>
array(
'sessid' =>
bitrix_sessid()));