Ask Your Question
0

curl to revealing the endpoints by json

asked 2014-11-06 05:22:35 -0500

New-stack gravatar image

updated 2014-11-06 21:57:34 -0500

9lives gravatar image

hi people,

I try to obtain a token from keystone to consume an api with this command

curl -d '{"auth":{"tenantName": "customer-x", "passwordCredentials": {"username": "demo", "password": "demopass"}}}' -H "Content-type: application/json" http://controller:35357/v2.0/tokens

curl -i -X GET http://controller:35357/v2.0/tenants -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: token"

The intent is read the json to read the content but i'm getting this error....

{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}

Previously i make source demo-openrc.... Where am I wrong?

edit retag flag offensive close merge delete

Comments

can you try it against the 5000 port instead the 35357?

Adrián Norte gravatar imageAdrián Norte ( 2014-11-06 05:30:12 -0500 )edit

can you paste the policy.json in /etc/keystone/, the demo user might not has admin role, change the port to 5000 if you are using user with non admin role for keystone v2.

Hope that helps!

9lives gravatar image9lives ( 2014-11-06 22:07:41 -0500 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2014-11-06 09:30:37 -0500

I believe you are using default setup. That call requires "admin" role in the default setup. I don't believe demo user has that role. Check whether the user has "admin" role

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-06 05:22:35 -0500

Seen: 226 times

Last updated: Nov 06 '14