Doone
Doone

Reputation: 81

How To Generate OpenStack Swift Access Token For Another User?

I have an account of an openstack swift and I can access objects in the swift using my user name and password. And my openstack swift adopt keystore to deal with auth.

Now I want to generate a token and another one can access an object in the swift only using the token. And the token will expire after a period.Can I do this? How can I do it?

Upvotes: 1

Views: 584

Answers (1)

First generate a token using:

$ curl -v -s -X POST $OS_AUTH_URL/auth/tokens?nocatalog   
-H "Content-Type: application/json"   -d '{ "auth": { "identity": { "methods": ["password"],
"password": {"user": {"domain": {"name": "'"$OS_USER_DOMAIN_NAME"'"},
"name": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"} } }, 
"scope": { "project": { "domain": { "name": "'"$OS_PROJECT_DOMAIN_NAME"'" }, 
"name":  "'"$OS_PROJECT_NAME"'" } } }}' \
| python -m json.tool

Then get the toke using:

$Keystone token-get

Upvotes: 0

Related Questions