当我从bitbucket服务器配置web钩子时,

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/job/api-xxxxxx/job/stg/job/xxxxxxxxxxx/</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>
<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.27.v20200227</a><hr/>
</body>
</html>
发布于 2020-06-16 09:10:07
我也面临着同样的错误。我可以建议您如何解决这个问题,但我不能保证它是安全的(使用基于令牌的身份验证)。
正如403状态代码明确指出的那样,这个URL是存在的,但是您的用户没有被授权访问该URL。
下面是如何使它工作的方法::
导航到Jenkins > Manage >配置全局安全>在授权下选择基于矩阵的安全性,并检查匿名用户下面的选项
---------------------------------------------
| User | Overall | Job |
|--------------------------------------------
| Anonymous | Read | Read, Workspace & |
| user | | Build |
--------------------------------------------保存这些变化。
然后导航到Jenkins > Configure >Build触发器>中的作业,然后选择“远程生成触发器(例如,从脚本)”。
选择此之后,将出现一个带有标记“身份验证令牌”的文本框,您可以在其中生成令牌。在文本框中输入一些文本以生成令牌。例如,您输入了OathToken。
现在导航到Bit Bucket > Repository Settings >Web钩子> Edit,并按如下方式输入URL:
JENKINS_URL/view/JenkinsViewName/job/JenkinsJobName/build?token=OathToken在上面的URL中,替换以下内容:
JENKINS_URL - With you original Jenkins url (http://Domain/)
JenkinsViewName - With the view name in your Jenkins pipeline
JenkinsJobName - With the job name in your Jenkins pipeline
OathToken - With your original Token value现在单击,它将返回201状态代码,它将在存储库中的新推送上触发构建。
同样,请考虑您的安全偏好。
https://stackoverflow.com/questions/62187465
复制相似问题