How to make a rest API call with OAuth

Abhinay June 1, 2017

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

1 accepted

2 votes
Answer accepted
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2017

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

Abhinay June 28, 2017

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

somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2017

Hi Abhinay,

Here are a couple resources I can provide:

The Atlassian 3-legged OAuth Example repository

This repo has examples for use in Java, Ruby, Perl, Python, Nodejs, php, and the source itself.

I would recommend looking through the examples listed there and try following those steps to see if you can get this working.

Cheers,

Branden

James Brown May 2, 2019

Is it possible to use Oauth with Bamboo Server. The documentation does not mention Oauth.

Suggest an answer

Log in or Sign up to answer