Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement OAUTH in nodejs with detailed info?

Rakesh Taninki
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 21, 2019

I have require to implement in nodejs. how can I start and go further. Please help me with easy steps.

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2019

Hi Rakesh,

I would recommend starting with https://developer.atlassian.com/cloud/jira/software/jira-rest-api-oauth-authentication/

It has a "show me the code" link in

The code for the final output of this tutorial is here: https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples 

I'm afraid that repo has moved to https://bitbucket.org/atlassianlabs/atlassian-oauth-examples/src/master/   From that link you can see there are different languages you can use to implement OAuth with Jira Cloud, including nodejs examples in https://bitbucket.org/atlassianlabs/atlassian-oauth-examples/src/dd0264cad0432ed514d2701367c5bfc2b2a18401/nodejs/?at=master

Using the README.md in that repo, along with the first link as a guide, you should be able to implement OAuth in a nodejs format.

I hope this helps.

Andy

mateusz dargacz
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 8, 2019
Like # people like this
AppConnect May 21, 2019

Hi Mateusz, thanks for sharing latest code. But the example doesn't works if I am not logged-in to JIRA.  In this case when I hit  http://localhost:8080/sessions/connect, it redirects me to JIRA login page. any idea what could be wrong.

Like Mohamed Aly likes this
GiancarlosIO
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!
June 30, 2019

Thank you Mateusz! works like a charm!

Like Mohamed Aly likes this
fabiobarreto NA
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!
September 13, 2020

Thank you Mateusz! Finally a working code!

SK Arman Ali
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!
July 27, 2021

Access to XMLHttpRequest at 'https://armanw3e.atlassian.net/plugins/servlet/oauth/authorize?oauth_token=7pBReZGW2THfEQTv2zNAl67sdAIkZKKq' (redirected from 'http://localhost:8080/api/v1/jira/connect?user_id=kralb9xobko2zen7g4e-1515430748&jira_host_url=https:%2F%2Farmanw3e.atlassian.net%2F') from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

facing this issue when I request from http://localhost:8081
but found okay from browser
could you please check, Thanks!

neeta_chavda
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 22, 2022

Have you find @SK Arman Ali for above cores issue???

Suggest an answer

Log in or Sign up to answer