Can't get an X-Storage-Url and X-Auth-Token

Asked by NAJMI Nizar

Hi,
Im testing a Swift environment and everything works perfectly except the "curl" command to get an X-Storage-Url and X-Auth-Token. I am using keystone in another host to authenticate. This is what i get :

[root@SWIFT-MACHINE ~]# curl -k -v -H 'X-Storage-User: admin:admin' -H 'X-Storage-Pass: cloud' http://192.168.224.248:5000/v2.0
* About to connect() to 192.168.224.248 port 5000 (#0)
* Trying 192.168.224.248... connected
* Connected to 192.168.224.248 (192.168.224.248) port 5000 (#0)
> GET /v2.0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 192.168.224.248:5000
> Accept: */*
> X-Storage-User: admin:admin
> X-Storage-Pass: cloud
>
< HTTP/1.1 200 OK
< Vary: X-Auth-Token
< Content-Type: application/json
< Content-Length: 616
< Date: Tue, 02 Apr 2013 10:34:03 GMT
<
* Connection #0 to host 192.168.224.248 left intact
* Closing connection #0
{"version": {"status": "beta", "updated": "2011-11-19T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "http://192.168.224.248:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "rel": "describedby"}]}}

When using the "swift" commad to get stats on my accounts, objects and containers as well as to upload or dowload object, everything works smoothly.

Thanks in advance for your help.

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Adrian Smith (adriansmith) said :
#1

The "X-Storage-User" and "X-Storage-Pass" headers are applicable when you're using swauth or tempauth for authentication. It appears you're using Keystone. A request to authenticate to Keystone should look something like this,

curl -d '{ "auth":{ "passwordCredentials":{ "username":"admin", "password":"cloud" }, "tenantName":"admin" }}' -H "Content-type: application/json" http://192.168.224.248:35357/v2.0/tokens

Can you help with this problem?

Provide an answer of your own, or ask NAJMI Nizar for more information if necessary.

To post a message you must log in.