Identity v3身份验证/令牌中没有目录

时间:2019-02-06 12:30:52

标签: openstack openstack-keystone

我正在关注OpenStack Keystone API Examples (using Curl)。尝试获取新令牌时,其响应不包含catalog对象。这是我发送CURL请求的方法:

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

预期结果(按文档):

HTTP/1.1 201 Created
X-Subject-Token: MIIFvgY...
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 1025
Date: Tue, 10 Jun 2014 20:55:16 GMT

{
  "token": {
    "methods": ["password"],
    "roles": [{
      "id": "9fe2ff9ee4384b1894a90878d3e92bab",
      "name": "_member_"
    }, {
      "id": "c703057be878458588961ce9a0ce686b",
      "name": "admin"
    }],
    "expires_at": "2014-06-10T2:55:16.806001Z",
    "project": {
      "domain": {
        "id": "default",
        "name": "Default"
      },
      "id": "8538a3f13f9541b28c2620eb19065e45",
      "name": "admin"
    },
    "catalog": [{
      "endpoints": [{
        "url": "http://localhost:3537/v2.0",
        "region": "RegionOne",
        "interface": "admin",
        "id": "29beb2f1567642eb810b042b6719ea88"
      }, {
        "url": "http://localhost:5000/v2.0",
        "region": "RegionOne",
        "interface": "internal",
        "id": "8707e3735d4415c97ae231b4841eb1c"
      }, {
        "url": "http://localhost:5000/v2.0",
        "region": "RegionOne",
        "interface": "public",
        "id": "ef303187fc8d41668f25199c298396a5"
      }],
      "type": "identity",
      "id": "bd73972c0e14fb69bae8ff76e112a90",
      "name": "keystone"
    }],
    "extras": {},
    "user": {
      "domain": {
        "id": "default",
        "name": "Default"
      },
      "id": "3ec3164f750146be97f21559ee4d9c51",
      "name": "admin"
    },
    "audit_ids": ["yRt0UrxJSs6-WYJgwEMMmg"],
    "issued_at": "201406-10T20:55:16.806027Z"
  }
}

我的结果:

HTTP/1.1 201 Created
Date: Wed, 06 Feb 2019 12:43:26 GMT
Server: Apache/2.4.29 (Ubuntu)
Content-Length: 312
X-Subject-Token: gAAAAABcWtZviro5jKoooS-wmaY8OJTI5d2jCToiQ4e3IxKlLkg3bdmC************
Vary: X-Auth-Token
X-Distribution: Ubuntu
x-openstack-request-id: req-************
Content-Type: application/json

{"token": {"issued_at": "2019-02-06T12:43:27.000000Z", "audit_ids": ["***********"], "methods": ["password"], "expires_at": "2019-02-06T13:43:27.000000Z", "user": {"password_expires_at": null, "domain": {"id": "default", "name": "Default"}, "id": "***********", "name": "admin"}}}

0 个答案:

没有答案