一、在请求头加上 crumb

我现在要使用 webhook 发一个 post 请求给 jenkins,结果报了 403 错误。一个可行的解决方案就是给这个请求头加上 crumb。

  1. 在桌面右击空白处点击 git bash, 输入以下命令获取 crumb:curl -u user:password "http://192.168.150.188:8000/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,%22:%22,//crumb)" 上面的 user:password 需要替换成你的真实账号密码,http://192.168.150.188:8000 需要替换成你自己的 ip 地址。
  2. Jenkins-Crumb: 后面那一串符号复制下来,它就是要添加的 crumb。现在正确的命令如下:curl -H 726749d6a7473b87b93aa07dd9960b6d943ac3535e5d90a0ee49d370d2ee77fa http://192.168.150.188:8000/job/helloworld/build?token=11aa657155f7265c6b4051a18fe61d5e66。(我原先的命令是 curl http://192.168.150.188:8000/job/helloworld/build?token=11aa657155f7265c6b4051a18fe61d5e66,可想而知,这是错误的)。

二、取消 csrf 验证

取消 csrf 验证需要在启动参数设置,由于我的系统为 windows,所以只需要打开 jenkins 安装目录下的 jenkins.xml1 文件,找到 <arguments> 标签,在里面加上 -Dhudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION=true。这样就可以正常执行命令而不会报 403 错误了。

这行代码的作用是关闭 csrf 验证,不关的话,gitea 的 webhook 会一直报 403 错误,无法使用。

加好参数后,在该目录命令行下输入 jenkins.exe restart 重启 jenkins。

jenkins 403 No valid crumb was included in the request 解决方案相关推荐

  1. [Jenkins]Error:403 No valid crumb was included in the request

    错误备忘 配置 jenkins 的时候,一直报这个错,是因为 jenkins 默认安全设置里面开启了 防止款站点请求伪造. 方法: 取消勾选这一项,就可以成功集成了 位置: Jenkins > ...

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

    背景介绍 开发的jenkins job 在local的 一台windows 上,而我们测试的jenkins job 在azure 上的一台windows server 2012 上.由于 azure上 ...

  3. Error 403 No valid crumb was included in the request 报错解决 容器化jenkins关闭CSRF

    现象 gitlab 连接 安装在容器中的jenkins时,如果使用的是高版本的 jenkins ,会出现403错误,Error 403 No valid crumb was included in t ...

  4. HTTP ERROR 403 No valid crumb was included in the request ~jenkins 太高的版本错误。降低版本

    HTTP ERROR 403 No valid crumb was included in the request URI: /buildByToken/build STATUS: 403 MESSA ...

  5. 解决Error:403 No valid crumb was included in the request

    Jenkins错误备忘:Error:403 No valid crumb was included in the request 在Jenkins上创建流水线后不能save,报这个错. 解决办法: 登 ...

  6. 火狐Error 403 No valid crumb was included in the request并且浏览器一直是loading中

    我用 linux 的火狐使用 jenkins 的时候报出 Error 403 No valid crumb was included in the request 然后访问 jenkins 的一些配置 ...

  7. jenkins2.3031 出现“Error 403 No valid crumb was included in the request ”的解决方案

    jenkins2.3031 出现"Error 403 No valid crumb was included in the request "的解决方案 记录一下,在配置jenki ...

  8. 【笔记】Jenkins- 解决 “Error 403 No valid crumb was included in the request“

    目录 问题 解决办法(亲测) 问题 HTTP ERROR 403 No valid crumb was included in the request 解决办法(亲测) Dashboard -> ...

  9. Jenkins RestAPI调用出现Error 403 No valid crumb was included in the request [亲测有用]

    方法一(不推荐): 在jenkins 的Configure Global Security下 , 取消"防止跨站点请求伪造(Prevent Cross Site Request Forger ...

最新文章

  1. Mysql 获取当月和上个月第一天和最后一天的解决方案
  2. python画椭圆-Python易学就会(五)turtle绘制椭圆与递归
  3. “放到桌面”的Servlet实现
  4. c++桥接模式bridge
  5. PowerDesigner如何导出建表sql脚本(转)
  6. 前端学习(1336):从数据库查询文档
  7. java conterller_java后台controller能否直接接收list
  8. LeetCode-118杨辉三角C++详解
  9. 全球首款五摄手机Nokia 9 PureView国行版发布:价格惊了!
  10. AWS 专家教你快速使用 Spring Boot 和 DJL!
  11. 阿里 虚拟主机和弹性web托管的具体区别是什么
  12. 笔记——关于每次重启之后,虚拟机网络无网络访问权限的解决方法
  13. 蓝桥杯单片机-ADC-A/D转换-测量PCF8591中AIN1通道(光敏电阻RD1)的电压
  14. ALPS语言学校(西雅图)|ALPS Language School (Seattle)
  15. 查找算法的实现c语言,查找算法的实现(C语言版)
  16. GITHUB下载慢解决办法-插件解决
  17. 2017软院金山WPS补题 L
  18. Linux —— 线程安全
  19. 在线审稿投稿管理系统,就这?
  20. T-SQL解析json字符串函数

热门文章

  1. 计算机考证一级一般多少钱
  2. 常德职业技术学院2018级新生军政训练总结表彰大会隆重召开
  3. 在线TSV转CSV工具
  4. 自动驾驶过冬,需要点燃“降本增效”的炉火
  5. 【逆向】i春秋入门实战——crack_me
  6. 【css】巧用border制作三角形
  7. 【返老还童】大脑衰老可逆转,只需注入年轻脑脊液 From Nature
  8. 有些人 总是莫名其妙的得罪了
  9. 发现了一个好玩的SQL函数-soundex()
  10. Unity3D网络游戏0.2