How to make a rest API call with OAuth Edited

Hi ,

How to make a rest API call with OAuth to JIRA server like

How to send consumer key, consumer secret, signature type ?

if they have to be sent through headers. what are the headers to be added and with which names?

 

I want to make API requests from my client application(web application) to Jira for creating project and custom fields, now am using basic authentication which is working fine. 

 

Thanks in advance.

1 answer

0 vote

Hi Ahbinay,

There is a guide you can start with titled JIRA REST API Example - OAuth authentication.  It explains how to allow REST clients to authenticate using OAuth.

Cheers,

Branden

Hi Branden,

Thanks for the response, I have gone through the guide on OAuth example.

But, the example uses a separate jar for obtaining access token which is required to be sent with each API call. 

My program makes multiple API requests to JIRA for which I am using Spring REST Template to GET and POST data.

How should I send Access Token with each API request? and Is there a way to obtain Access Token without using the jar given by JIRA.

 

Regards,

Abhinay

Hi Abhinay,

Here are a couple resources I can provide:

The Atlassian 3-legged OAuth Example repository

The Java Source Code is there as well: Source

Read through the source and the examples and you should be able to create your own methods.

Cheers,

Branden

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

496 views 2 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you