Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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:

V3:

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

V2:

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?

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

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:

V3:

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

V2:

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?