cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evan Miller <>
Subject Having trouble getting a CloudStack API URL with api_key and generated signature to work from the browser (Firefox).
Date Fri, 08 Jun 2012 02:38:20 GMT

Right now, I am just testing a simple, final API-based url with signature in a browser. 
I am getting the following authentication related error in the browser:

{ "listvirtualmachinesresponse" : {"errorcode" : 401, "errortext" : "unable to verify user
credentials and/or request signature"}  }

Here is the final API-based url:

Here is how I built that final url:

Using perl, it is based on the following pieces:

my $cs_ip = '';
my $base_url = 'http://' . "$cs_ip" . ':8080'; 
my $api_path = '/client/api?'; 
my $api_key = '8v_gevjjgdjbbhibmlle4yyhkseqhrefztnv4up2fu3k9y12th7lscsn6-7seago1ycctnute1ot0v7npcus8q';
my $secret_key = 'kNd2VxlXxCXwyJGlidr0ZcmcqXSH2refwxZTStD6If4vJu4QmJPOIui0rgr88mDI6DuGQTzP9eQNOjlZBTReKg';

The api_key and secret key come from my account (evan) in domain 1. 
The keys were just generated in a new CloudStack GUI session.
The evan account has ROOT Domain privileges.

Then, following directions in the Developer's Guide ...

The sorted, lower-case command string ($sorted_lc_cmd) is:


I obtained the hex signature in perl as follows:

$signature = hmac_sha1_hex ($sorted_lc_cmd, $secret_key);

And, then, put together the final url, as above, with the calculated signature.

What am I doing wrong or missing?

Evan Miller 
Citrix Systems. Inc. 
View raw message