I recently installed devstack to play with Openstack API.
Following Openstack API Quickstart I run the following command to get an authentication token:
curl -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "openstack"}, "tenantId": "793e8386d75f47b1bd078a3c0ddd9a49"}}' -H "Content-type: application/json" http://192.168.1.20:5000/v2.0/tokens
Then I get as return:
{"access": {"token": {"issued_at": "2013-04-20T17:53:58.538559", "expires": "2013-04-21T17:53:58Z", "id": "MIIKVgYJKoZIhvcNAQcCoIIKRzCCCkMCAQExCTAHBgUrDgMCGjCCCS8GCSqGSIb3DQEHAaCCCSAEggkceyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0wNC0yMFQxNzo1Mzo1OC41Mzg1NTkiLCAiZXhwaXJlcyI6ICIyMDEzLTA0LTIxVDE3OjUzOjU4WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJkZW1vIiwgImlkIjogIjc5M2U4Mzg2ZDc1ZjQ3YjFiZDA3OGEzYzBkZGQ5YTQ5In19LCAic2VydmljZUNhdGFsb2ciOiBbeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTkyLjE2OC4xLjIwOjg3NzQvdjIvNzkzZTgzODZkNzVmNDdiMWJkMDc4YTNjMGRkZDlhNDkiLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5hbFVSTCI6ICJodHRwOi8vMTkyLjE2OC4xLjIwOjg3NzQvdjIvNzkzZTgzODZkNzVmNDdiMWJkMDc4YTNjMGRkZDlhNDkiLCAiaWQiOiAiMDYxNGU5OWM5ODZlNGZhZjg2NmZmZjMyZTNkNDA2OTIiLCAicHVibGljVVJMIjogImh0dHA6Ly8xOTIuMTY4LjEuMjA6ODc3NC92Mi83OTNlODM4NmQ3NWY0N2IxYmQwNzhhM2MwZGRkOWE0OSJ9XS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Dc3NjZlNDRiMmE4NWUzMmQxMzQ2ZjQ1NDI5IiwgInJvbGVzIjogW3sibmFtZSI6ICJhZG1pbiJ9XSwgIm5hbWUiOiAiYWRtaW4ifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFsiMzk3MmVmOTc5YzM5NGVmNzg3ZTFkMGI0ODIyOTY3OWMiXX19fTGB-zCB-AIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIEwVVbnNldDEOMAwGA1UEBxMFVW5zZXQxDjAMBgNVBAoTBVVuc2V0MRgwFgYDVQQDEw93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEgYCu8vRsIpBqcWqbqDKqHguQ92y6B7h4pkieEYgu5i34NDeM-0niAnLrvCK7T8iKAODtSaycgL7jolvLwztVdR2ps6JVtck67w05TZqdE7CNbHkZP22BS87tT1aXqnYxvXl9UvQvxOzOLTBraGad+kutyCMlHjIdz+p3x-u1jnqZAA==", "tenant": {"enabled": true, "description": null, "name": "demo", "id": "793e8386d75f47b1bd078a3c0ddd9a49"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.20:8774/v2/793e8386d75f47b1bd078a3c0ddd9a49", "region": "RegionOne", "internalURL": "http://192.168.1.20:8774/v2/793e8386d75f47b1bd078a3c0ddd9a49", "id": "0614e99c986e4faf866fff32e3d40692", "publicURL": "http://192.168.1.20:8774/v2/793e8386d75f47b1bd078a3c0ddd9a49"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.1.20:3333", "region": "RegionOne", "internalURL": "http://192.168.1.20:3333", "id": "4c27ff143d62445d9cf3481f47a1de03", "publicURL": "http://192.168.1.20:3333"}], "endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"adminURL": "http://192.168.1.20:9292", "region": "RegionOne", "internalURL": "http://192.168.1.20:9292", "id": "3b440b7cd5ae4728b88a8706b4d2f0e5", "publicURL": "http://192.168.1.20:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.1.20:8776/v1/793e8386d75f47b1bd078a3c0ddd9a49", "region": "RegionOne", "internalURL": "http://192.168.1.20:8776/v1/793e8386d75f47b1bd078a3c0ddd9a49", "id": "75e1b95e19834ff78972fcb73279c77d", "publicURL": "http://192.168.1.20:8776/v1/793e8386d75f47b1bd078a3c0ddd9a49"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.168.1.20:8773/services/Admin", "region": "RegionOne", "internalURL": "http://192.168.1.20:8773/services/Cloud", "id": "87d75a889f4f4fdb81b056bdc59e3a9a", "publicURL": "http://192.168.1.20:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"adminURL": "http://192.168.1.20:35357/v2.0", "region": "RegionOne", "internalURL": "http://192.168.1.20:5000/v2.0", "id": "02d093845f734442bf98131e3f06f805", "publicURL": "http://192.168.1.20:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", "roles_links": [], "id": "329a707766e44b2a85e32d1346f45429", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["3972ef979c394ef787e1d0b48229679c"]}}}
I notice that from the JSON metadata output it returns "is_admin": 0 .
Why is that?
I was expecting Keystone to return 1.
Regards
来源:https://stackoverflow.com/questions/16123625/keystone-returning-token-with-metadata-is-admin-0