gpt4 book ai didi

Ansible Tower API 不接受 token

转载 作者:行者123 更新时间:2023-12-02 16:36:57 28 4
gpt4 key购买 nike

我正在 Tower 服务器中执行以下 POST:

http://<my-tower-url>/api/v2/job_templates/10/launch/


Headers:
Content-Type:application/json
Authorization:sometokenhere

并返回错误:

{"detail":"Authentication credentials were not provided."}

还尝试过以下方法:

Headers:
Content-Type:application/json
Authorization:Token sometokenhere

按照建议here .

POST 正文中传递原始用户名/密码时,也会发生同样的情况(并跳过 Authorization header ):

{
"username": "myusername",
"password": "mypass",
"inventory": "inventoryname",
"verbosity": 0,
"extra_vars": {
"var1": "somevar1",
"var2": "somevar2",
"var3": "somevar3",
"var4": "somevar4",
"var5": "somevar5"
}
}

知道为什么这不起作用吗?

最佳答案

Authorization: Bearer <oauth2-token-value>

See here ,“3. OAuth 2 token 身份验证”部分,“Curl 示例”部分。

关于Ansible Tower API 不接受 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50215862/

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