jenkins 出现“Error 403 No valid crumb was included in the request ”的解决方案

背景介绍

开发的jenkins job 在local的 一台windows 上,而我们测试的jenkins job 在azure 上的一台windows server 2012 上。由于 azure上机器的网络比local的网络好,所以测试不愿意把测试job建在开发的jenkins上,开发也觉得迁移自己的job到azure上麻烦。那我们只能使用Remote access API(https://wiki.jenkins.io/display/JENKINS/Remote+access+API) ,来让开发的job 主动来触发在azure的测试job。

使用如下命令来让local 的jenkins job 去主动触发 azure上测试的jenkins job

curl -X POST http://168.192.10.78:8080/job/AndroidTestCase/build --user xiaohua:3a2522f75356f6791f6040bf9ee3808b 

执行后在jenkins出现如下错误:

<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</h2>
<p>Problem accessing /job/AndroidTestCase/build. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

解决方案:
在jenkins 的Configure Global Security下 , 取消“防止跨站点请求伪造(Prevent Cross Site Request Forgery exploits)”的勾选。(如下图)这里写图片描述

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值