Ask Your Question

How to make the same query in the V2 and V3 keystone API?

asked 2016-07-25 06:48:02 -0500

sarahw gravatar image

updated 2016-07-25 18:23:03 -0500

I'm new to Openstack and just installed Mitaka. I got the v3 keystone API working but some software I'm installing depends on v2. For some reason I am unable to authenticate with the v2 API and get a token, even though the equivalent request to the v3 API works correctly. Here are the two requests I'm making:


curl -i   -H "Content-Type: application/json"   -d '
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "admin",
          "domain": { "name": "default" },
          "password": "PASSWORD"
}'   http://SERVER:35357/v3/auth/tokens


curl -d -H "Content-Type: application/json"
'{"auth": {
      "passwordCredentials": {
             "username": "admin",
             "password": "PASSWORD"
      "tenantName": "admin"
   }'  http://SERVER:35357/v2.0/tokens

The V3 request returns a token, but the V2 request fails with:

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

Is there something obvious I'm doing wrong? Is there a setting I'm missing to make the V2 API work?

Edit: I tried again today using Openstack Liberty and I had no problems making these queries to the v3 and v2 APIs. Perhaps this is a Mitaka bug?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-12-20 07:43:07 -0500

Vinoth gravatar image


To enable keystone v2 on latest release of openstack, You need to add default_domain_id in the /etc/keystone/keystone.conf file,


default_domain_id  = xxxxxxxx32ea5xxxxx2b6f93

Don't forget to run Keystone DB sync.

su -s /bin/sh -c "keystone-manage --config-file /etc/keystone/keystone.conf db_sync" keystone

Then, Restart the apache service.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-07-25 06:48:02 -0500

Seen: 1,101 times

Last updated: Dec 20 '16