Hi all, I struggle a bit setting up the Webhook fo...
# pactflow
m
Hi all, I struggle a bit setting up the Webhook for the pact verification pipeline of the provider. I added the trigger to the GitLab Repository and can call that successfully when using Postman. But the same call when testing the webhook setup fails and returns an 401 error. Does anyone know what I'm missing?
Copy code
[2024-04-18T08:09:56Z] DEBUG: Webhook context {"base_url":"<https://foo.pactflow.io>","event_name":"test"}
[2024-04-18T08:09:56Z] INFO: HTTP/1.1 POST <https://gitlab.foo/api/v4/projects/42/trigger/pipeline?token=********&ref=master>
[2024-04-18T08:09:56Z] INFO: accept: */*
[2024-04-18T08:09:56Z] INFO: user-agent: Pact Broker v2.109.1
[2024-04-18T08:09:56Z] INFO: host: gitlab.foo
[2024-04-18T08:09:56Z] INFO: content-length: 0
[2024-04-18T08:09:56Z] INFO: content-type: application/x-www-form-urlencoded
[2024-04-18T08:09:56Z] INFO: 
[2024-04-18T08:09:56Z] INFO: HTTP/1.1 401 Unauthorized
[2024-04-18T08:09:56Z] INFO: content-length: 36
[2024-04-18T08:09:56Z] INFO: content-type: text/html; charset=UTF-8
[2024-04-18T08:09:56Z] INFO: x-goog-iap-generated-response: true
[2024-04-18T08:09:56Z] INFO: date: Thu, 18 Apr 2024 08:09:56 GMT
[2024-04-18T08:09:56Z] INFO: alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[2024-04-18T08:09:56Z] INFO: Invalid IAP credentials: empty token
[2024-04-18T08:09:56Z] INFO: Webhook execution failed
m
Mind sharing how you setup the webhook vs the postman test?
It seems to suggest the token is empty, based on that error
m
Sure, this is the webhook setup
thankyou 1
And postman
I also tried setting up the webhook without the secret reference but with the token in the url in clear text
m
Are there other headers in the postman tab that need to be sent?
In the docs it suggests adding an
accept: application/json
but that may not be the problem