openstack dashborad进不去3-13 11:47:04.585 42651 WARNING keystone.server.flask.application [req-b1130741-8231-4a45-801c-c30ee024aee5 db7aa867257240efa04ac6ac461982d6 1f4e139da2f84adb8cab1a32555c06a9 - default default] You are not authorized to perform the requested action: identity:list_roles.: ForbiddenAction: You are not authorized to perform the requested action: identity:list_roles. 2025-03-13 11:49:58.610 42650 WARNING keystone.server.flask.application [req-74204480-07b9-4f25-8c89-112e159f7624 db7aa867257240efa04ac6ac461982d6 1f4e139da2f84adb8cab1a32555c06a9 - default default] You are not authorized to perform the requested action: identity:list_groups.: ForbiddenAction: You are not authorized to perform the requested action: identity:list_groups. ^C [root@gxc1-controller ~]# ^C [root@gxc1-controller ~]# sudo tail -f /var/log/keystone/keystone.log 2025-03-13 11:46:55.963 42650 WARNING keystone.server.flask.application [req-4ed35e62-5186-40b8-9cf7-49d0c3e0e387 db7aa867257240efa04ac6ac461982d6 1f4e139da2f84adb8cab1a32555c06a9 - default default] You are not authorized to perform the requested action: identity:list_groups.: ForbiddenAction: You are not authorized to perform the requested action: identity:list_groups. 2025-03-13 11:47:04.578 42651 WARNING py.warnings [req-b1130741-8231-4a45-801c-c30ee024aee5 db7aa867257240efa04ac6ac461982d6 1f4e139da2f84adb8cab1a32555c06a9 - default default] /usr/lib/python2.7/site-packages/oslo_policy/policy.py:997: UserWarning: Policy identity:list_roles failed scope check. The token used to make the request was project scoped but the policy requires ['system'] scope. This behavior may change in the future where using the intended scope is required warnings.warn(msg) 2025-03-13 11:47:04.585 42651 WARNING keystone.server.flask.application [req-b1130741-8231-4a45-801c-c30ee024aee5 db7aa867257240efa04ac6ac461982d6 1f4e139da2f84adb8cab1a32555c06a9 - default default] You are not authorized to perform the requested action: identity:list
时间: 2025-03-13 16:13:45 浏览: 55
### OpenStack Dashboard 访问问题及身份验证错误分析
当遇到 `identity:list_users` 或其他类似的权限拒绝错误时,通常是因为用户的令牌作用域(scope)未正确设置或缺少必要的角色权限。以下是针对此问题的详细解决方案:
#### 1. 配置 Keystone 身份服务
确保 Keystone 已正确定义并创建了所需的服务实体和服务端点。可以通过以下命令完成操作:
```bash
openstack service create --name keystone --description "OpenStack Identity" identity[^1]
```
#### 2. 查看日志文件定位问题
如果在 Horizon 中遇到了特定的操作被拒绝的情况,可以检查 Apache 日志以获取更多信息:
```bash
vim /var/log/httpd/openstack_dashboard-error.log[^2]
```
通过日志中的具体报错信息进一步确认问题所在。
#### 3. 安装和配置 Keystone 组件
为了确保 Keystone 的正常运行,需安装相关依赖包,并将其与 MariaDB 数据库集成。执行如下命令来安装所需的组件:
```bash
yum install openstack-keystone httpd mod_wsgi memcached python-memcached -y[^3]
```
同时,在 `/etc/keystone/keystone.conf` 文件中更新数据库连接字符串,将默认密码替换为自己设定的安全密码。
#### 4. 授权范围校验警告处理
对于 `identity:list_roles` 和 `identity:list_groups` 权限不足的问题,可能的原因在于当前登录用户的角色不具备这些 API 请求所需要的权限级别。需要为项目内的用户分配适当的角色,例如 admin 或 member 角色。可通过以下方式实现:
```bash
openstack role add --project demo --user demo _member_
openstack role add --project demo --user admin admin
```
另外,还需注意的是,某些请求可能会因为 token 缺少有效的 project scope 导致失败。因此建议在发起敏感资源查询前先切换到目标项目的上下文中再尝试重新加载页面或者刷新会话缓存。
#### 5. 修改 Policy.json 文件调整策略控制
最后一种可能性涉及 policy rules 设置不当引发的行为约束冲突现象。可编辑对应版本路径下的 policies 文件夹里的 json 文档修改规则表达式放宽限制条件满足实际需求即可解决问题比如允许非管理员也能读取组成员列表之类的场景应用实例演示代码片段如下所示:
```json
{
"identity:list_users": "",
"identity:list_groups": ""
}
```
以上更改完成后记得重启 web server 及其关联进程使改动生效:
```bash
systemctl restart httpd.service
```
---
###
阅读全文
相关推荐
