0
我試圖通過在Bash腳本中從Jenkins下載構建工件。但是,我使用GitHub進行身份驗證,甚至使用屬於管理員用戶的API密鑰,我只收到403
錯誤,無法成功下載。使用cURL和GitHub身份驗證從Jenkins下載工件
我curl
命令如下:
curl -u me:myapitoken -k 'https://jenkins.example.com/job/my-project/lastSuccessfulBuild/artifact/output/artifact_name'`
頭輸出表明詹金斯認爲我的身份登錄的管理員,但我得到了403
錯誤,但無法下載神器。
< HTTP/1.1 403 Forbidden
< Date: Tue, 28 Jun 2016 10:03:55 GMT
< Server: Jetty(winstone-2.9)
< X-Content-Type-Options: nosniff
< X-You-Are-Authenticated-As: <me>
< X-You-Are-In-Group: authenticated
< X-Required-Permission: hudson.model.Hudson.Read
< X-Permission-Implied-By: hudson.security.Permission.GenericRead
< X-Permission-Implied-By: hudson.model.Hudson.Administer
< Cache-Control: no-cache,no-store,must-revalidate
< X-Hudson-Theme: default
< Content-Type: text/html;charset=UTF-8
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< X-Hudson: 1.395
< X-Jenkins: 1.656
< X-Jenkins-Session: fbdxxxxx
< X-Hudson-CLI-Port: 51518
< X-Jenkins-CLI-Port: 51518
< X-Jenkins-CLI2-Port: 51518
< X-Frame-Options: sameorigin
< X-Instance-Identity: MIIBIjANBgkqhkiG9w0B<...>XwIDAQAB
< X-SSH-Endpoint: jenkins.example.com:53605
< Content-Length: 5166
< Set-Cookie: JSESSIONID.xxxxxxx=b2rxxxxxxxxxx5btw3e;Path=/;Secure;HttpOnly
該鏈接在瀏覽器中正常工作,同時登錄到GitHub和Jenkins。
有沒有人有任何想法通過curl
認證當使用GitHub作爲主要身份驗證提供者?