码迷,mamicode.com
首页 > Windows程序 > 详细

Jenkins RestAPI调用出现Error 403 No valid crumb was included in the request

时间:2017-12-30 20:27:18      阅读:804      评论:0      收藏:0      [点我收藏+]

标签:eve   style   请求   信息   gpo   error   XML   bre   ali   

方法一(不推荐):

在jenkins 的Configure Global Security下 , 取消“防止跨站点请求伪造(Prevent Cross Site Request Forgery exploits)”的勾选

 

方法二:

1、获取用户API token

http://Jenkins_IP:8080/user/zhangyi/configure

点击 show API Token,假设是API_TOKEN

2、计算CRUMB

CRUMB=$(curl -s http://USER:API_TOKEN@Jenkins_IP:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb))

3、请求时附带CRUMB信息即可

curl -X POST -H "$CRUMB" http://USER:API_TOKEN@cd.web.tc.ted:8080/reload

 

Jenkins RestAPI调用出现Error 403 No valid crumb was included in the request

标签:eve   style   请求   信息   gpo   error   XML   bre   ali   

原文地址:https://www.cnblogs.com/imzye/p/8150974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!