Question

I'm following a tutorial to install swift openstacl object storage, in the lattests steps it ask me to do this : ------- "curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' url:8080/auth/v1.0" ------to Get an X-Storage-Url and X-Auth-Token and after that cheking that i can get an account by typing : curl -v -H 'X-Auth-Token:token-from-x-auth-token-above' url-from-x-storage-url-above

Have any one an idea what such command can mean ? i don't really understand its rules ! i know it's king of identification, but what exactly mean ?

Thank you

Was it helpful?

Solution 2

In short, you send your password and account to Swift, and then Swift sends back token and url to you. Token stands for a authenticated account/password pair. URL stands for who is responsible for this account. In reality settings, there can be two groups of proxy servers: A and B. A is only for authentication. B is for storage access. After authentication, A sends back X-Storage-Url to user, and the X-Storage-Url is B's doman name.

You can use the token and the url to access storage. For example,

curl -v -H 'X-Auth-Token: <token>' <url> means you can access the account

curl -v -H 'X-Auth-Token: <token>' <url>/container_name -XPUT means you want to create container container_name under the account.

curl -v -H 'X-Auth-Token: <token>' <url>/container_name/object_name -T localfile means you want to upload localfile to the container and name it object_name.

The token is generated by the middleware. In Swift, there are 3 auth middlewares you can choose: tempauth, swauth, and keystone.

You can also set different X-Storage-Urls for different accounts, if you have load-balancing concerns.

OTHER TIPS

enter code herecurl curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction

So once you Issue

curl -i -X GET -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://127.0.0.1:8080/auth/v1.0

curl is setting up the Header namely Key,Value Pair to Swift Auth System to validate with TempAuth system The header are

X-Auth-User
X-Auth-Key

Finally you will get a OK if AUTH passes

HTTP/1.1 200 OK

and if you see the Header it will contains the information like

X-Storage-Url: http://127.0.0.1:8080/v1/AUTH_myaccount
X-Auth-Token: AUTH_tk7790238141c343bdb6ad1303e3d3bc00
Content-Type: text/html; charset=UTF-8
X-Storage-Token: AUTH_tk7790238141c343bdb6ad1303e3d3bc00
Content-Length: 0
X-Trans-Id: txab863ae755ec4c8d9aa19-0054bfda6f
Date: Wed, 21 Jan 2015 16:57:19 GMT

Here is sample link that explains the TempAuth

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top