It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to provide Bearer token in webhook url

Hi

We have exposed a API to process the updates made on issue which needs an Bearer token for authentication.

I would like to call this service using webhooks . Is there any way i can provide the authentication token in the webhook URL ?

i am getting 401 error as i didnt specify the token

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads Atlassian Team Mar 04, 2019

Hi Abhinay,

Currently Jira Cloud does not support sending basic auth over webhooks. There's an open feature request here to provide that functionality: JRACLOUD-31953

If your API accepts tokens as part of the URL, you can simply tack that on at the end of the URL you've entered in Jira. As an example, your service might have an endpoint of

https://service.yourdomain.com/services/hooks/incoming

and if it supports accepting tokens via query string, you might be able to just append them on the URL:

https://service.yourdomain.com/services/hooks/incoming?token=599lm8lXxJkR82152KMzrkq8 

This depends highly on what the service at the other end is. If it's something your company has developed internally, talk to the developer responsible for it and see if they have built it in a way that will accept the token in the URL vs only accepting over a basic auth header.

Cheers,
Daniel

Hi Daniel ,

Thanks for a quick response. Below is our full requirement.

we need to trigger an API when ever any updates(comments ,status changes etc) occur on a jira issue.

The API can only support oauth(using Bearer Token ). We thought of achieving this using webhooks , but we are stuck with passing the authentication headers. If you are saying that we cant pass headers on webhooks, then is there any way we can trigger the API , for any updates on JIRA issue ?

 

From postman we just pass below header for the API

Authorization : Bearer XXXXXXXXXXXXXXXXXXXXXX

 

Thanks

Abhi

Hey Abhi,

I've gone around a bit on the Jira Cloud webhooks and confirmed there's not currently a way for a Jira Cloud webhook to send something directly to your API in the way you've described. It comes back to that JRACLOUD-31953 issue that's currently open.

However, I think there's a possibility for you to use Zapier if you don't mind some glue between Jira and your API.

image.png

Using the Zapier apps for Jira Cloud and Webhooks, you can have Zapier retrieve the issue updated event from Jira and pass it on to your API. The "Webhooks by Zapier" app includes the options you need for headers under its Custom Request event type. It's an extra layer in the process, but should get you the results you're after.

image.png

Hope that helps!
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you