2017-06-23 27 views
3

我按以下方式在帆布鞋中配置了jenkins並設置了三角帆管道。Spinnaker:403請求中沒有包含有效碎屑

jenkins: 
    # If you are integrating Jenkins, set its location here using the baseUrl 
    # field and provide the username/password credentials. 
    # You must also enable the "igor" service listed separately. 
    # 
    # If you have multiple jenkins servers, you will need to list 
    # them in an igor-local.yml. See jenkins.masters in config/igor.yml. 
    # 
    # Note that jenkins is not installed with Spinnaker so you must obtain this 
    # on your own if you are interested. 
    enabled: ${services.igor.enabled:false} 
    defaultMaster: 
     name: default 
     baseUrl: http://server:8080 
     username: spinnaker 
     password: password 

但是我在嘗試運行大三角帆管道時看到下面的錯誤。

Exception (Start Jenkins Job) 403 No valid crumb was included in the request

回答

7

要解決這個問題,我未選中在jenkins.com/configureSecurity節「防止跨站請求僞造攻擊」,並開始工作。

Prevent Cross Site Request Forgery exploits

+0

它爲我工作像魅力@Balkrishna –

3

碎屑無非是訪問令牌。下面是API來獲取屑

https://jenkins.xxx.xxx.xxx/crumbIssuer/api/json //你的網址詹金斯取代它,並進行GET呼叫您的郵遞員或REST的API調用者。

這將生成的輸出,如:

{ 
    "_class": "hudson.security.csrf.DefaultCrumbIssuer", 
    "crumb": "ba4742b9d92606f4236456568a", 
    "crumbRequestField": "Jenkins-Crumb" 
} 

下面是更多的細節和鏈接與相同: How to request for Crumb issuer for jenkins 詹金斯的wiki頁面: https://wiki.jenkins-ci.org/display/jenkins/remote+access+api

如果要調用通過REST的API相同呼叫,結帳下面的鏈接,它是如何使用jenkins-crumb解釋如何致電休息電話

https://blog.dahanne.net/2016/05/17/how-to-update-a-jenkins-job-posting-config-xml/ 

舉例:

curl -X POST http://anthony:[email protected]:8080/jenkins/job/pof/config.xml --data-binary "@config.xml" -data ".crumb=6bbabc426436b72ec35e5ad4a4344687" 
+0

@Balkrishna:難道是工作,或者你仍然有問題? –

+0

我正在嘗試使用大三角帆進行配置。捲曲請求可用,但不適用於大三角帆配置。 – Balkrishna

+0

直接在瀏覽器中訪問'/ crumbIssuer/api/json'讓我回到了正軌。 –