Ask Your Question
0

how to get an openstack token and validate it?

asked 2012-05-20 15:27:25 -0500

acme-ican gravatar image

I followed this guide: http://keystone.openstack.org/api_curl_examples.html (http://keystone.openstack.org/api_cur...)

and it seemed that I got a valid token by ran:

curl -d '{"auth":{"passwordCredentials":{"username": "can", "password": "mypassword"}}}' -H "Content-type: application/json" http://url:35357/v2.0/tokens

and it returned:

{ "access": { "token": { "expires": "2012-05-21T14:35:17Z", "id": "468da447bd1c4821bbc5def0498fd441" }, "serviceCatalog": {}, "user": { "username": "can", "roles_links": [], "id": "bb6d3a09ad0c4924bf20c1a32ccb5781", "roles": [], "name": "can" } } }

but when I came to the next few sections to validate this token, I encountered this magic number: X-Auth-Token:999888777666. At first I thought it's the token I got but I was wrong.

I think I may have missed something, so I read related sections in openstack documents( http://keystone.openstack.org/configuration.html (http://keystone.openstack.org/configu...) and http://docs.openstack.org/api/openstack-compute/programmer/content/ (http://docs.openstack.org/api/opensta...) ), but still no idea how the number comes from.

could anyone explain to me

1)what's the meaning of that magic number 2)how to get the right value of it so I can get a working token to manage other parts of openstack

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2013-02-19 08:12:32 -0500

willierjyt gravatar image

I tried this way : curl -H "X-Auth-Token: $TOKEN_ID" http://url:35357/v2.0/tokens/$TOKEN_ID , and all worked well.

edit flag offensive delete link more
0

answered 2012-05-21 00:04:26 -0500

acme-ican gravatar image

I said it's not the token. I tried this way:

curl -H "X-Auth-Token: 468da447bd1c4821bbc5def0498fd441" http://url:35357/v2.0/tokens/468da447bd1c4821bbc5def0498fd441 (http://url:35357/v2.0/tokens/468da447...)

and got a 401 not authorized

edit flag offensive delete link more
0

answered 2012-05-20 18:50:23 -0500

heckj gravatar image

That number is an example, and is meant to be replaced by the token you retrieved when posting appropriate credentials to Keystone. In your example, where the value "999888777666" is used, replace it with the token you retrieved: "468da447bd1c4821bbc5def0498fd441"

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-05-20 15:27:25 -0500

Seen: 175 times

Last updated: Feb 19 '13