Error while performing login: PERMISSION_DENIED

Discussion space for community admins

Moderators: hugo, alexandre, rmvanarkel

Post Reply
faisal
Posts: 6
Joined: Sun Feb 16, 2020 9:50 pm

Error while performing login: PERMISSION_DENIED

Post by faisal »

I am trying to get login via WEB-RPC but i am getting this error

`Error while performing login: PERMISSION_DENIED`

i already give permission of web service permission to my admin account but still nothing

below i share my code

[ Note: i am using cyclos 4.8 library]

autoload file

Code: Select all


    function load($c) {
        if (strpos($c, "Cyclos\\") >= 0) {
            include str_replace("\\", "/", $c) . ".php";
        }    
    }

    spl_autoload_register('load'); 

    Cyclos\Configuration::setRootUrl("url");
    Cyclos\Configuration::setAuthentication("admin_account_username", "admin_account_password");


login file

Code: Select all

$loginService = new Cyclos\LoginService();

// Set the parameters
$params = new stdclass();
$params->user = array("principal" => 'user_account_username');
$params->password = 'user_account_password';
$params->remoteAddress = $_SERVER['REMOTE_ADDR'];

// Perform the login
try {
	$result = $loginService->loginUser($params);
} catch (Cyclos\ConnectionException $e) {
	echo("Cyclos server couldn't be contacted");
	die();
} catch (Cyclos\ServiceException $e) {
	switch ($e->errorCode) {
		case 'VALIDATION':
			echo("Missing username / password");
			break;
		case 'LOGIN':
			echo("Invalid username / password");
			break;
		case 'REMOTE_ADDRESS_BLOCKED':
			echo("Your access is blocked by exceeding invalid login attempts");
			break;
		default:
			echo("Error while performing login: {$e->errorCode}");
			break;
	}
	die();
}
can someone please point me the right direction ?

Post Reply