jenkins Trigger builds remotely 403

在默认配置下使用 jenkinsTrigger builds remotely功能时出现403错误:

[root@qqmm ~]# curl -i http://jenkins.cent.com/job/jenkins_test/build?token=buildnow
HTTP/1.1 403 Forbidden
Server: nginx/1.6.3
Date: Wed, 01 Jun 2016 15:51:51 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 883
Connection: keep-alive
X-Content-Type-Options: nosniff
Set-Cookie: JSESSIONID.4acf60f6=1nmoouils0l6l1ey51fiw1syj4;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Hudson: 1.395
X-Jenkins: 2.6
X-Jenkins-Session: 983eb0cf
X-You-Are-Authenticated-As: anonymous
X-You-Are-In-Group:
X-Required-Permission: hudson.model.Hudson.Read
X-Permission-Implied-By: hudson.security.Permission.GenericRead
X-Permission-Implied-By: hudson.model.Hudson.Administer

<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2Fjenkins_test%2Fbuild%3Ftoken%3Dbuildnow'/><script>window.location.replace('/login?from=%2Fjob%2Fjenkins_test%2Fbuild%3Ftoken%3Dbuildnow');</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> 

解决方式

  1. 使用其他插件代替 https://wiki.jenkins-ci.org/display/JENKINS/Build+Token+Root+Plugin
  2. 或者在jenkins配置中勾选下图的选项即可

    《jenkins Trigger builds remotely 403》 jenkins_remote_build.png

参考:

  1. http://stackoverflow.com/questions/16267060/jenkins-trigger-builds-remotely-with-token-not-working-when-matrix-authoriza
  2. https://wiki.jenkins-ci.org/display/JENKINS/Quick+and+Simple+Security
    原文作者:明天的明abc
    原文地址: https://www.jianshu.com/p/6d519721e32a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞