Ask Your Question

Problem with getting a token in keystone

asked 2014-07-07 04:59:33 -0500

anhdenday gravatar image

updated 2014-07-07 10:53:12 -0500

smaffulli gravatar image

I am deploying keystone from the source code. After running keystone by the command : "tools/ bin/keystone-all". I want to get a token following the example at openstack document site: I am using the command from Keystone API curl examples

curl -i \
  -H "Content-Type: application/json" \
  -d '
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "admin",
          "domain": { "id": "default" },
          "password": "adminpwd"
}' \
  http://localhost:5000/v3/auth/tokens ; echo

But my result is :

HTTP/1.1 401 Unauthorized
Www-Authenticate: Keystone uri="http://localhost:5000"
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 114
Date: Mon, 07 Jul 2014 09:54:18 GMT
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}

I dont know why? Maybe the password for admin is not correct? How can i change the password...?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-07-07 10:54:18 -0500

smaffulli gravatar image

Make sure you can authenticate to keystone using keystone-client first, read the documentation to learn how to change the password, where to find the logs to understand more about your installation.

edit flag offensive delete link more

answered 2014-07-07 13:21:43 -0500

updated 2014-07-15 11:10:03 -0500

smaffulli gravatar image

If you installed from source code, did you upload sample data. If not then there is no "admin" user. Please check the users table in database.

If you haven't uploaded sample data, then upload sample data from . That file itself has password for the admin user.

Admin password is in Please use that password. If that doesn't work then reset the password

To reset the password, use ( PATCH /v3/users/{user_id})

Since you don't know any password , you need to reset using admin token. In keystone.conf check the admin token value. Default value is "ADMIN".


Assuming you are using default value , run the curl command given in the example after setting OS_TOKEN= <admin token="" value="">

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-07-07 04:59:33 -0500

Seen: 1,417 times

Last updated: Jul 15 '14