How to request for the crumb issuer for Jenkins

前端 未结 8 1280
孤城傲影
孤城傲影 2020-12-08 05:09

I want to use the Jenkins Remote API, and I am looking for safe solution. I came across Prevent Cross Site Request Forgery exploits and I want to use it, but I

8条回答
  •  误落风尘
    2020-12-08 05:35

    Or you can use Python and requests instead

    req = requests.get('http://JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)', auth=(username, password))
    print(req.text)
    

    will give you the name and the crumb:

    Jenkins-Crumb:e2e41f670dc128f378b2a010b4fcb493
    

提交回复
热议问题