简体   繁体   中英

How to add header (for jenkins crumb) to github webook?

We are trying to setup a webhook so that we can trigger jobs on our publicly accessible Jenkins server using https://github.com/blar/blar/settings/hooks

The form offers us a "Payload URL" field, but no field to provide additional headers. This means we cannot provide a Jenkins crumb so that the request can authenticate properly. Without the header with the crumb we get the following response from the webhook delivery:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /ghprbhook. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>

How can we tell github the headers we want to use???

Please refer - https://stackoverflow.com/a/59861256/1726235

Try to authenticate with API key instead of Password

So github doesn't currently support headers, but it turned out that in my case this was a total red herring. I simply missed a slash on my URL https://stackoverflow.com/a/51545557/1586965

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM