• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

API RPC authentification error

albans

Regular Pleskian
Hi,

I'm trying to use the Plesk RPC API, and I can't log-in correctly.

I use the following PHP code, taken from several example I found:
define ('HOST', 'myserver.com');
define ('PORT', 8443);
define ('PATH', 'enterprise/control/agent.php');

$url = 'https://' . HOST . ':' . PORT . '/' . PATH;

echo $url;

$headers = array(
'HTTP_AUTH_LOGIN: admin',
'HTTP_AUTH_PASSWD: xxxx',
'Content-Type: text/xml'
);


// initialize the curl engine
$ch = curl_init();

// set the curl options:
// do not check the name of SSL certificate of the remote server
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);

// do not check up the remote server certificate
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

// pass in the header elements
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// pass in the url of the target server
curl_setopt($ch, CURLOPT_URL, $url);

// tell CURL to return the result rather than to load it to the browser
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_POST, true);

I always get the following error, when I try with the admin login.

error 1001 Authentication failed - wrong password.

Should I use another login? I tried with the login of the client level user and it didn't work either.

Thanks!
 
Okay, fantastic: I SOLVED THE PROBLEM!!!
It was linked to the length of my password (> 15 caracters)...
I simply modified it to a shorter one, and everything's running smoothly!
So, I guess it's good to know not to lose days tryin' ;o)
 
Back
Top