• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/oauth/provider.php
  • Класс: BitrixRestOAuthProvider
  • Вызов: Provider::authorizeClient
public function authorizeClient($clientId, $userId, $state = '')
{
	if($userId > 0)
	{
		$additionalParams = $this->getTokenParams(array(), $userId);

		$client = $this->getClient();
		$codeInfo = $client->getCode($clientId, $state, $additionalParams);

		if($codeInfo['result'])
		{
			return $codeInfo['result'];
		}
		else
		{
			return $codeInfo;
		}
	}

	return false;
}