oauth token in rest-api-request with oauth

After a successfull login via oauth  I'm receiving a bunch of data.

"oauth_token" => "07HQgsnnXaaaaaaaaaaki0GA9wGj2ThO"
"oauth_token_secret" => "2853FBbR5WbbbbbbbbbbIdQIMp5kmXVw"
"oauth_expires_in" => "157680000"
"oauth_session_handle" => "2a2ccccccccccKRiQmrl7EsPQd7f0QD7"
"oauth_authorization_expires_in" => "160272000"

 

I would like to make api-calls to the rest api. In the Authentication-chapter of the documentation (https://docs.atlassian.com/jira/REST/cloud/#auth/1/session-currentUser) it's listet that the oauth authentication is the prefered method. 

In the LInked examples it's clear thet username:password authentication is way easier (https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials). In fact in the whole documentation there are all examples with the easier username:password authentication( fred:fred). In my case I'm wondering how the token after a oauth-authentication is transfered in a request to the rest-api. 

Do I have to add it to the header? With which name? Or do i have to append it to every url? 

The only "valid" help is this line, but herer you cannot see how the access token is included into the request

java -jar rest-oauth-client-1.0.one-jar.jar request ACCESS_TOKEN JIRA_REST_URL

Has anyone solved this already? Where do I have to put the oauth_token?

Best Regards

 

4 answers

This widget could not be displayed.

Hi @Simon Franz. Are you using P2 or Atlassian Connect?

This widget could not be displayed.

We have the same exact issue,, I have been looking for the answer everywhere, Did u find solution, If so please share.

we are using Atlassian cloud

This widget could not be displayed.

@pradeep raju the example fields in the question are for OAuth 1, which is not a supported authentication mechanism in Cloud.

To make REST API calls in Cloud you use Atlassian Connect, which enables and secures add-ons.

The documentation on Atlassian Connect authentication is here.

This widget could not be displayed.

@Simon Franz @pradeep raju Sorry, I must clarify my answer. I was thinking of Atlassian Connect, the primary way of extending Cloud products. Connect does not support OAuth 1.

 

JIRA Cloud itself does, however. This page has a guide that includes where to put the token: https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/

I highly encourage you to use Connect if possible, when calling JIRA Cloud APIs. It gives you an installation lifecycle, the option of UI extensions, and doesn't consume a user license.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

111 views 2 0
Join discussion

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