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.