简体   繁体   English

向Openstack API发出的卷曲请求返回403禁止错误

[英]Curl request to Openstack API returns 403 forbidden error

I am using openstack api as given below: 我正在使用如下所示的openstack api:

curl -i -X GET " https://cloud.lab.fiware.org:5000/v3/users?name=username " -H "X-Auth-token:token" 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. 它给出403错误代码为“禁止”。

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 HTTP / 1.1 403禁止的服务器:nginx / 1.4.6(Ubuntu)日期:2019年1月30日星期三10:55:04 GMT内容类型:application / json内容长度:136连接:keep-alive变化:X-Auth -令牌X分发: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"}} {“错误”:{“消息”:“您无权执行所请求的操作: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 ) (来自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. 可能是,您使用普通用户的令牌请求了API,然后出于安全原因,您无法获取所请求用户的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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