HOW TO do authorization code call in POSTMAN

Abhishek Jaswal February 3, 2021

I am asking for JIRA software 

the way to do OAUTH2.0 authentication call is here: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/

from this document I got to know how to authenticate using OAUTH2.0. But the thing is I have to put the Authorization code URI in Browser to get the auth code you can refer to this

video: https://www.youtube.com/watch?v=ayiGEctaky0&t=4s

timestamp: 2:48 onwards

then after that I can make the access token request with the help of that AUTH code

but what I want to know is , how can I do this AUTHORIZATION CALL  thing in POSTMAN

How can I do the Authorization call inside postman?????

2 answers

0 votes
Cody Claxton
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2022

If you use your authorization URL that is in your developer console, paste that into your browser.  Your code should be returned in the URL.  Take that code and do the steps that @Abhishek Jaswal mentioned above and you will get your access token that you can save to make requests.  Hope that helps for anyone who runs into the same problem

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2021

Hello @Abhishek Jaswal ,

 

If I understand correctly you are following the steps (quoted below) of the section named Implementing OAuth 2.0 (3LO) of the documentation page you linked, and you are asking how to execute step #2 (Exchange the authorization code for an access token) using POSTMAN. Is this correct?

Implementing OAuth 2.0 (3LO)

Once you have enabled OAuth 2.0 (3LO) for your app, you can implement it in your app's code. There are a number of key parts to this:

  1. Direct the user to the authorization URL to get an authorization code
  2. Exchange the authorization code for an access token
  3. Authorize any calls to the product APIs using the access token
  4. Check site access for the app

 

If my understanding is correct, then you can just use the same data from the Curl example that is just below the title of the second step and put it in the corrispettive fields in Postman:

curl --request POST \ 
--url
'https://auth.atlassian.com/oauth/token' \
--header
'Content-Type: application/json' \
--data
'{"grant_type": "authorization_code","client_id": "YOUR_CLIENT_ID","client_secret": "YOUR_CLIENT_SECRET","code": "YOUR_AUTHORIZATION_CODE","redirect_uri": "https://YOUR_APP_CALLBACK_URL"}'

 

Find in the below screenshot the corrispettive fields in Postman:

postman.jpg

 

Of course you also have to add the content-type:

postman2.jpg

 

Finally, for the future, please notice that this is not the best place to get help on development  related questions. The right resources are listed in https://developer.atlassian.com/resources. 

Specifically:

 

Cheers,
Dario

Abhishek Jaswal February 7, 2021

Hi @Dario B 

I wanted to know about step 1 of this document :

https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/

PFA , this is the error I am getting when I am doing the authorization code call from the postman 

But when i did the same over the browser , I just pasted the same Auth URI over the browser so then it took me to the login page and then from there I granted the consent and after that It redirected me to my callback URL with the code 

But the same Procedure I want to implement over postman

please see if you could help me 

Capture3.PNGCapture2.PNG

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 16, 2021

Hello @Abhishek Jaswal ,

I am not sure I understand correctly what you are asking for. However, being this a development related question, you may want to go ask the Developers Community.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events