VMware Cloud Community
clabman
Contributor
Contributor

vCO api and Authentication

I'm trying to authenticate myself on vCO api, but I always have a 401 response : Full authentication is required to access this resource.

According to this document : , I have done : http://pubs.vmware.com/vsphere-51/index.jsp?topic=/com.vmware.vsphere.vco_develop_web_services.doc/G...

First of all I retrieve h-o-k  with vCO SDK :

./run.sh com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample https://IP:PORT/ims/STSService login pass

it returns :

Token details:
AssertionId = _******
Token type = Holder-Of-Key
Issued On = 2013-02-25T15:31:43.972Z
And then I tryed to authenticate myself on vCO Rest api with this command :
curl -ki https://IP:PORT/api/users/ -H "Autorization:*******" -X GET
But it always returns me : HTTP/1.1 401 Full authentication is required to access this resource
Have you any idea of the problem ?
Thanks for your help !!!
Reply
0 Kudos
3 Replies
Burke-
VMware Employee
VMware Employee

If you did copy/paste, then you have a typo: "Autorization" -- should be "Authorization", right?

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
clabman
Contributor
Contributor

Yes you are right !!

Sorry my mistake.  I replace autorization with authorization and now I have another error, seems my token is not good !

curl -ki https://IP:PORT/api/users -H "Authorization:******" -X GET
HTTP/1.1 401 The HTTP token has invalid syntax!

Do I have to specify my token in base 64 ?

Reply
0 Kudos
clabman
Contributor
Contributor

Perhaps I do not send the right token ?

I used this sample script provides with the vCO SDK : ./run.sh com.vmware.sso.client.samples.AcquireHoKTokenByUserCredentialSample https://IP:PORT/ims/STSService login pass

Do you think this is the right way ?

Thanks for your help again.

Reply
0 Kudos