Jenkins: 403 No valid crumb was included in the request

前端 未结 16 1834
野性不改
野性不改 2020-12-05 01:44

I configured jenkins in spinnaker as follows and setup spinnaker pipeline.

 jenkins:
    # If you are integrating Jenkins, set its location here using the bas         


        
16条回答
  •  庸人自扰
    2020-12-05 02:39

    Finally, this post helped me to do away with the crumb problem but still securing Jenkins from CSRF attack.

    Solution for no-valid crumb included in the request issue

    Basically, we need to first request for crumb with authentication and then issue POST api calls with crumb as a header along with authentication again.

    This is how I did it,

    curl -v -X GET http://jenkins-url:8080/crumbIssuer/api/json --user :
    

    Response was,

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

    Then the POST api with above crumb information in it.

    curl -X POST http://jenkins-url:8080/job//build --user : -H 'Jenkins-Crumb: 0db38413bd7ec9e98974f5213f7ead8b'
    

提交回复
热议问题