我在POST
服务器中执行以下Tower
:
http://<my-tower-url>/api/v2/job_templates/10/launch/
Headers:
Content-Type:application/json
Authorization:sometokenhere
找回错误:
{“detail”:“未提供身份验证凭据。”}
还尝试了以下内容:
Headers:
Content-Type:application/json
Authorization:Token sometokenhere
建议here。
在POST
正文中传递原始用户名/密码时,如下所示(并跳过Authorization
标题):
{
"username": "myusername",
"password": "mypass",
"inventory": "inventoryname",
"verbosity": 0,
"extra_vars": {
"var1": "somevar1",
"var2": "somevar2",
"var3": "somevar3",
"var4": "somevar4",
"var5": "somevar5"
}
}
知道为什么这不起作用吗?
答案 0 :(得分:0)
Authorization: Bearer <oauth2-token-value>
See here,“ 3。OAuth 2令牌认证”部分,“卷曲示例”部分。