【发布时间】:2018-07-02 11:12:15
【问题描述】:
我正在尝试将我的 Jenkins 配置为允许使用 REST API 触发远程作业。如果我使用基本身份验证标头参数传递用户名和密码,我就可以触发作业
-u <username>:<api token> http://localhost:8080/job/kp-push-example/build
但是,如果我在 url 中传递用户名和 api 令牌,Jenkins 将无法进行身份验证,它使用匿名用户并引发错误,因为匿名用户没有执行工作的优势。
http://<username>:<apitoken>@localhost:8080/job/kp-push-example/build
以下是错误信息。
<html>
<head>
<meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2Fkp-push-example%2Fbuild'/>
<script>window.location.replace('/login?from=%2Fjob%2Fkp-push-example%2Fbuild');</script>
</head>
<body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
</body>
</html>
如何配置 Jenkins 以允许 url 基本身份验证? 詹金斯版本:2.129
【问题讨论】:
标签: jenkins