gpt4 book ai didi

fiware - 即使使用管理员权限,Keyrock 也不接受用户

转载 作者:行者123 更新时间:2023-12-02 11:33:03 25 4
gpt4 key购买 nike

我创建了两个用户,一个是管理员,具有管理员权限,另一个用户现在也具有管理员权限,但最初是社区(我将此帐户称为社区)。

我已向社区用户注册了一个应用程序,并稍后关联了管理员。作为callbackUrl,我已在我的 keyrock 实例中注册了以下地址

<keystone ip>:/oauth2/token 

我发出的获取 oauth2 的请求如下,它使用 https://raw.githubusercontent.com/Bitergia/fiware-chanchan-docker/master/images/pep-wilma/4.3.0/auth-token.sh作为指导方针。我更改了用户、通行证、主机、客户端 ID 和应用程序 key

curl -s --insecure -i --header "Authorization: Basic NmJjODMyMWMzNDQwNGVlYzkwYzNhNzhlYTU0ZTE2NjY6M2YwMzQyZjE4ZTM1NGI0ZDg5YjhlYWVkNTZmNGI5Mjc=" --header "Content-Type: application/x-www-form-urlencoded" -X POST http://<keyrock IP>/oauth2/token -d 'grant_type=password&username=<user>&password=<pass>&client_id=<clientID>&client_secret=<secret>'

请求到达 keystone 并回复 404(未找到访问 token )。

当我尝试从 keyrock 为管理员和社区获取 oauth2 token 时,它说

Error: Root - User access-token not authorized

我可以使用两个用户登录 Horizo​​n。

为了从 idm 获取 oauth2 token ,我错过了什么?

编辑:用于创建用户的代码:

users_default_pass = '...'
user0 = _register_user(keystone,"user0",passwd=users_default_pass)
keystone.roles.grant(user=user0.id,role=keystone.roles.find(name='community'), project=user0.default_project_id)

Edit2:原始响应和使用 tcpflow 捕获的 keystone 的响应

请求:

POST /oauth2/token HTTP/1.1
User-Agent: curl/7.35.0
Host: 130.206.118.xxx:5000
Accept: */*
Authorization: Basic ZWU2YmFjMWNjOTQ3NDdhNmI4MTU3NDdiNDk5NmVhZjQ6NTRkY2NjMjgxODhhNDMxYTk4OTY3MjkwN2UxYjIxYzY=
Content-Type: application/x-www-form-urlencoded
Content-Length: 143

grant_type=password&username=admin&password=admin&client_id=ee6bac1cc94747a6b815747b4996eaf4&client_secret=54dccc28188a431a989672907e1b21c6
write error to stdout

回复:

HTTP/1.1 404 Not Found
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 93
Date: Wed, 09 Sep 2015 09:46:19 GMT

{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
write error to stdout

最佳答案

我花了一段时间才找到它:)

KeyRock ,oauth2在Horizon中实现。查看您的请求,我发现了几件事:

  • 您正在使用 HTTP 而不是 HTTPS
  • 正在向端口 5000 发送请求(通常为 Keystone)

这让我觉得你的要求违背了 Keystone .

默认情况下,KeyRock handle oauth2请求 Horizon ,这意味着使用 https 和端口 443。正如你所说,针对 Keystone 发出请求失败:

  HTTP/1.1 404 Not Found
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 93
Date: Wed, 09 Sep 2015 15:36:34 GMT

{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}

确保您针对 Horizon 执行请求使用 HTTPS 和端口 443 一切都应该正常!

关于fiware - 即使使用管理员权限,Keyrock 也不接受用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32462583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com