• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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