Ask Your Question
0

How to use scoped token in curl request?

asked 2016-10-06 07:10:32 -0500

spsingh gravatar image

I have obtained a scope token from the unscoped token. I want to use this scoped token in my curl request but it does not contain any id. How can I use this scoped token in curl request without any id ? Here follows the scoped token I have received:

{
    "token": {
        "audit_ids": [
            "74K4lZixQ_G27Hnh0f-T1A"
        ],
        "catalog": [
            {
                "endpoints": [
                    {
                        "id": "b3febdabea8948058ddb5df865ae47b0",
                        "interface": "admin",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:35357/v2.0"
                    },
                    {
                        "id": "eec2072af9964d74910066d92f0397a6",
                        "interface": "internal",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:5000/v2.0"
                    },
                    {
                        "id": "f18a4ac25aae438098591b453fe1de69",
                        "interface": "public",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:5000/v2.0"
                    }
                ],
                "id": "16c611d1a46f4dd6ac4a849db779297a",
                "name": "keystone",
                "type": "identity"
            },
            {
                "endpoints": [],
                "id": "217aa9d75300418497d44628b6fba294",
                "name": "nova",
                "type": "compute"
            },
            {
                "endpoints": [],
                "id": "50f8b317ee4e421889da55f063df9e24",
                "name": "cinderv2",
                "type": "volumev2"
            },
            {
                "endpoints": [],
                "id": "76db5e1f6f5041bb87cfa845deb109c5",
                "name": "nova_legacy",
                "type": "compute_legacy"
            },
            {
                "endpoints": [],
                "id": "ab2a375563ce4dd28f4af51a2085a200",
                "name": "cinder",
                "type": "volume"
            },
            {
                "endpoints": [
                    {
                        "id": "397b33c3cc6449e4968a009bce39c6c5",
                        "interface": "public",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:9292"
                    },
                    {
                        "id": "7ef39afc4ef74c698863c1009d51d256",
                        "interface": "internal",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:9292"
                    },
                    {
                        "id": "b929c089c73d4a1ba34ab9e7e981f98f",
                        "interface": "admin",
                        "region": "RegionOne",
                        "region_id": "RegionOne",
                        "url": "http://10.0.0.10:9292"
                    }
                ],
                "id": "bcd99e844b6a4ee09b2dbada3736528b",
                "name": "glance",
                "type": "image"
            }
        ],
        "domain": {
            "id": "default",
            "name": "Default"
        },
        "expires_at": "2016-10-06T08:32:28.566725Z",
        "issued_at": "2016-10-06T07:32:28.566761Z",
        "methods": [
            "token"
        ],
        "roles": [
            {
                "domain_id": null,
                "id": "04658ec28986434399689245b93b477e",
                "name": "admin"
            }
        ],
        "user": {
            "OS-FEDERATION": {
                "groups": [
                    {
                        "id": "1c1dfb8acc5642009fdda353bb7e0900"
                    }
                ],
                "identity_provider": {
                    "id": "openam_idp"
                },
                "protocol": {
                    "id": "oidc"
                }
            },
            "domain": {
                "id": "Federated",
                "name": "Federated"
            },
            "id": "0b09e2a68c9e4843a71628cfc801cbbb",
            "name": "0b09e2a68c9e4843a71628cfc801cbbb"
        }
    }
}
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-10-07 02:22:41 -0500

spsingh gravatar image

I found the answer for this trivial issue. The TOKEN ID lies in http header. The http header you can print through -D option in curl command.

edit flag offensive delete link more
0

answered 2016-10-07 00:37:32 -0500

Mohit gravatar image

In this token domain id is null , unsure why , you need to convert this to json dictionary and check for the key ['token']['id'] is the value you looking for.

You can use the python single liner http://stackoverflow.com/questions/38...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-10-06 07:10:32 -0500

Seen: 154 times

Last updated: Oct 07 '16