openstack - How to get token ID in keystoneclient v3 -


i got token id in kystoneclient v2 command:

token = keystone.auth_ref['token']['id'] 

but when move kystoneclient v3, please kindly let me know how can token id. try same above command. error.

in keystone client v3, authentication response returns token id in header rather in response body, named "x-subject-token".

you can see changes here:

https://developer.openstack.org/api-ref/identity/v3/index.html?expanded=list-endpoints-detail,create-credential-detail,validate-and-show-information-for-token-detail,password-authentication-with-unscoped-authorization-detail

i had tried token perl this:

my $res = $agent->post(     $self->{auth_url} . "/auth/tokens",     content_type => 'application/json',     content      => to_json($authkeystone) ); $headerdata = $res->{_headers}; $tokenid = $headerdata->{'x-subject-token'}; 

it works!


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -