简体   繁体   中英

Curl request to Openstack API returns 403 forbidden error

I am using openstack api as given below:

curl -i -X GET " https://cloud.lab.fiware.org:5000/v3/users?name=username " -H "X-Auth-token:token"

However, it doesn't return me any result. It gives 403 error code as Forbidden.

Please find the below response

HTTP/1.1 403 Forbidden Server: nginx/1.4.6 (Ubuntu) Date: Wed, 30 Jan 2019 10:55:04 GMT Content-Type: application/json Content-Length: 136 Connection: keep-alive Vary: X-Auth-Token X-Distribution: Ubuntu X-Openstack-Request-Id: req-9948991c-83f2-452b-b942-2ff3d5a9c5eb

{"error": {"message": "You are not authorized to perform the requested action: identity:list_users", "code": 403, "title": "Forbidden"}}

Just admin privilege could get list of users: "As an administrator, you manage projects, users, and roles." ( from https://docs.openstack.org/keystone/pike/admin/cli-manage-projects-users-and-roles.html )

I asume that you provided a correct token. What I mean is that this operation has to be launched by an authorised user with enough privileges to get this information. Probably, you requested the API with a token of a normal user and then you cannot get the information for the requested user for security reasons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM