Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69142

How to read HTTP headers with Jenkins, when using generic webhook trigger

       
      in bitbucket I managed to trigger jenkins by using a webhook. I added the jenkins url and I can read the body of the HTTP request. For this I used a Generic Webhook.

      Now I want to read the header as well. but somehow I dont know how to do this. My aim is it to read the X-Hub-Signature and then compare with the Bitbucket Signature. The header of Bitbucket is described here https://confluence.atlassian.com/bitbucketserver076/event-payload-1026535078.html

      I can see from Bitbucket that it is sending the X-Hub-Signature but cant figure out how to recieve it on jenkins site. If somehow has an advice, then I would be grateful.

          [JENKINS-69142] How to read HTTP headers with Jenkins, when using generic webhook trigger

          Tomas Bjerre added a comment -

          Did you see this page? https://plugins.jenkins.io/generic-webhook-trigger/

          Did you search for "header" on that page?

          Tomas Bjerre added a comment - Did you see this page? https://plugins.jenkins.io/generic-webhook-trigger/ Did you search for "header" on that page?

          John Bon added a comment -

           

          yes I saw that page. I was thinking maybe the HMAC is helpful to read the H-Hub-Signature, but I didnt see that in my Generic Webhook Trigger as option. Maybe i need an extra plug in, but it is not mentoned which one I need. Maybe you can tell me how i can see that whitelist enabled option?

          John Bon added a comment -   yes I saw that page. I was thinking maybe the HMAC is helpful to read the H-Hub-Signature, but I didnt see that in my Generic Webhook Trigger as option. Maybe i need an extra plug in, but it is not mentoned which one I need. Maybe you can tell me how i can see that whitelist enabled option?

          Tomas Bjerre added a comment -

          You will find it in the global /configure page of the Jenkins installation. You will not find it in the job configuration.

          Tomas Bjerre added a comment - You will find it in the global /configure page of the Jenkins installation. You will not find it in the job configuration.

          John Bon added a comment -

          thank you. It seems it works now.

          John Bon added a comment - thank you. It seems it works now.

            tomasbjerre Tomas Bjerre
            john_bon John Bon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: