Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Webhook Test not setting X-Hub-Signature

I have a Webhook with a Secret and when I run Test connection the response is 401 and the Request does not include the X-Hub-Signature header. This Webhook was working then started failing and troubleshooting revealed this. If I take one of the failed request and POST it with it's headers (including X-Hub-Signature) it works. It just stopped working from bitbucket. 

2 answers

@Rob_Decker I invested alot of time on this issue and finally fixed it by using the CEL expression interceptors, as following. 

In this Trigger, we are using the overlays to add the "X-Hub-Signature" to the body of the payload, where expression value i.e., 1234567 doesn't matter it can be anything, we are just adding the HMAC to the body so that we will not get an error. 

Note: By default there is no interceptor for the bitbucket CLOUD

kind: Trigger
name: energy
serviceAccountName: pipeline
- ref:
name: "cel"
- name: "filter"
value: "header.match('X-Event-Key', 'repo:push')"
- name: "overlays"
- key: X-Hub-Signature
expression: "1234567"
- ref: energy
ref: energy

I tried the Test Connection request with GET and it worked outside of bitbucket. The responses from within bitbucket and the outside tool are both from the same server where the request is being made but the bitbucket responses are requesting basic auth with a WWW-Authenticate header.

did you ever get this working? I can't even see where to specify the secret for a webhook for repo on Bitbucket Cloud.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,485 views 3 10
Read article

Atlassian Community Events