Welcome, Guest
Username: Password: Remember me
Archived CloudStack Forums for reference purposes please direct all future inquiries to the Apache CloudStack mailing lists.

incubator.apache.org/cloudstack/mailing-lists.html
  • Page:
  • 1
  • 2

TOPIC: Signature or request problem

Signature or request problem 2 years 3 months ago #6813

  • abruno
  • abruno's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Hi, i got this api URL

http://192.168.118.103:8080/client/api?apikey=yOw3A6i7mwzyu1_G9uu9ESeK2YRHgPN1pYx-5wcCoZl6Wk1AZIVD-cAHh-N8jfvngPo5IZcy01fhd8vsphc5Jg&command;=listAccounts&response;=json&signature;=uaxpzn3dikny1efmq847lqromdm%3D

my secretkey is: QmOKuipA8dqbtjGqGByUnermp04KCpid_9xMBsvp3Qxv-4NDBKp8OFX8ItI3UsT328STNJpZZNzpgvV6FZCMCw

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

does the signature is right? did i comit and error on my coding?
or i need to send anything else?


Thanks
The administrator has disabled public write access.

Re: Signature or request problem 2 years 1 month ago #7277

  • davidchiu
  • davidchiu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 1
  • Karma: 0
I met the same problem, who can tell me how to generate the signature?thx!

192.201.0.182:8080/client/api?apiKey=lqh...9X8dP7s/5zThrGeN3/A=

API Key:lqhHvm40_efQ42KZZ5v9a5WCmdzgP8kGN7Q7Xl6zjcGH7CPYnX6DDaYrVwYAxxTiDLqAngwlwr1H_2dYjX8QJASecret Key:ZYm6z1TUIWk-bkDkF1jvVu29Nx40VYgo0Wa2g_wenCIdglI6jW2S5HMO5EMOS-jE0x39eqBqYIf_wJ4dsOm1TQ
Last Edit: 2 years 1 month ago by davidchiu.
The administrator has disabled public write access.

Re: Signature or request problem 2 years 1 month ago #7283

  • ke4qqq
  • ke4qqq's Avatar
  • OFFLINE
  • Administrator
  • Posts: 620
  • Thank you received: 69
  • Karma: 22
So with your secret key and apikey, I came up with:

http://x.x.x.x:8080/client/api?apikey=yOw3A6i7mwzyu1_G9uu9ESeK2YRHgPN1pYx-5wcCoZl6Wk1AZIVD-cAHh-N8jfvngPo5IZcy01fhd8vsphc5Jg&command;=listAccounts&response;=json&signature;=KcW13NZn%2bw%2f1J8sSxFxN6q6EuIY%3d

So a couple of things I would guess are around your problem.
To sign the request the command needs to be all lower case (however you will have to revert this after getting the signature.)

I used snumano's generate-url script and ran:

./generate-url.pl -u "command=listaccounts&response;=json" -a yOw3A6i7mwzyu1_G9uu9ESeK2YRHgPN1pYx-5wcCoZl6Wk1AZIVD-cAHh-N8jfvngPo5IZcy01fhd8vsphc5Jg -s QmOKuipA8dqbtjGqGByUnermp04KCpid_9xMBsvp3Qxv-4NDBKp8OFX8ItI3UsT328STNJpZ

Note the capitalization above and in the url it generated below:
http://x.x.x.x:8080/client/api?apikey=yOw3A6i7mwzyu1_G9uu9ESeK2YRHgPN1pYx-5wcCoZl6Wk1AZIVD-cAHh-N8jfvngPo5IZcy01fhd8vsphc5Jg&command;=listaccounts&response;=json&signature;=KcW13NZn%2bw%2f1J8sSxFxN6q6EuIY%3d

That will declare that it doesn't know what command listaccounts is, so you have to change listaccounts to listAccounts in that url and it works fine.
The administrator has disabled public write access.
The following user(s) said Thank You: davidchiu

Re: Signature or request problem 2 years 1 month ago #7284

  • ke4qqq
  • ke4qqq's Avatar
  • OFFLINE
  • Administrator
  • Posts: 620
  • Thank you received: 69
  • Karma: 22
The administrator has disabled public write access.
The following user(s) said Thank You: davidchiu

Re: Signature or request problem 2 years 1 month ago #7295

  • davidchiu
  • davidchiu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 1
  • Karma: 0
Thank you very much, I didn't use "URLEncode" to encode the signatue.Now I resolve the problem!
The administrator has disabled public write access.

Re: Signature or request problem 1 year 2 months ago #12363

  • vibhork
  • vibhork's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
I am trying to use CloudStack APIs but didn't got success. I read about generate-url.pl and downloaded that file. Tried to install it as follows:
cpan -i generate-url.pl
But it is saying

CPAN: Storable loaded ok (v2.20)
Going to read '/home/vibhor/.cpan/Metadata'
Database was generated on Wed, 22 Aug 2012 05:19:03 GMT
Warning: Cannot install generate-url, don't know what it is.
Try the command

i /generate-url/

to find objects with matching identifiers.
CPAN: Time::HiRes loaded ok (v1.9719)

Can anybody exactly(step by step) tell me how to use this generate-url.pl. This would be great help as I am stuck since a long time to figure this out.

Thanks in advance.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.322 seconds

Open@Citrix

Citrix supports the open source community via developer support and evangeslism. We have a number of developers and evangelists that participate actively in the open source community in Apache Cloudstack, OpenDaylight, Xen Project and XenServer. We also conduct educational activities via the Build A Cloud events held all over the world. 

Connect