How to consume Jira API in React or any other UI application

Pavel Lazhbanau
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!
May 27, 2020

Hi,

 

Previously we use basic authentication to consume Jira REST API and display Jira tasks in the UI application. Our UI app directly sent a request with Authorisation header (basic auth) and received an answer. 

As basic auth is deprecated now we have to migrate to OAuth for REST APIs. here is an example of how it might be implemented with java app, but how to do the same process directly from the client application? Shell we somehow handle RSA-SHA1 keys from UI as well?

 

Any feedback is appreciated.

 

Thanks,

Pavel

1 answer

0 votes
Raffaele Messina July 12, 2021

Hi

i am currently having the same issue with a React app; what i discovered so far: you can't do a POST request from your react frontend because of CORS policy. So you should do it via your backend. I saw that there is a way to whitelist domains in jira SERVER, but i can't find this option for jira SOFTWARE; in doing so, you could whitelist your localhost or front end site, and send POST request to Jira and create ticket for example. I am still using basic Auth.

This is what i discovered so far, but i'm investigating more to see if i can directly create a ticket with a post request from frontend, without the need of using backend

deena_dc
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!
November 29, 2021

Hi  Raffaele Messina,

Can we do GET/POST calls directly from React?  Did you come across any solution to solve CORS? 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events