Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

passport-atlassian-oauth2 Edited

Hi Folks,

I've created a project using node module "passport-atlassian-oauth2" and i get the accessToken successfully. But when I do a request to create an issue I get the error "

Client must be authenticated to access this resource.

". Below is my code for create issue jira api:

var bodyData = { "fields": { "project": { "key": "FLUX" }, "summary": "REST ye merry gentlemen.", "description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": { "name": "Bug" } } };

var baseUrl = 'https://alamrezoanul.atlassian.net';

var options = { method: 'POST', url: `${baseUrl}/rest/api/3/issue`, data: JSON.stringify(bodyData), headers: { 'Authorization': 'Bearer ' + jiraTokens.accessToken, 'Content-Type': 'application/json' }, json: true };
axios(options) .then((response2) => { console.log("response2.data: ", response2.data); }) .catch((error) => { console.log("error: ", error); })

 

Could you help please?

3 answers

1 accepted

Dario B Atlassian Team Aug 28, 2019

Thanks for sharing @alamrezoanul !

As already mentioned, for the future please remember to ask this kind of questions in the Developers Community instead :) 

Cheers,
Dario

0 votes
Dario B Atlassian Team Aug 27, 2019

Hi @alamrezoanul ,

 

I may not be the best person to answer this question, however, before going any further, can you kindly let us know what you are trying to achieve?

I am asking this because, as written in the OAuth 2.0 (3LO) for apps documentation page, different authorization methods should be used in different scenarios and you might need to use a different one: 

Which authentication method should I use?

 

Also, as mentioned on the top of the passport-atlassian-oauth2 documentation page:

Before using passport-atlassian-oauth2 you must register an application within App Management.

Have you actually done this?

 

Finally, kindly notice that this is not the best place to get help on development related issues. For the future, please refer to the resources listed in: https://developer.atlassian.com/cloud/jira/platform/get-help/

Specifically:

 

Cheers,
Dario

Hi Dario, Thanks for your answer. It is solved by asking a question in stackoverflow. Thanks anyway.

Like Dario B likes this
Dario B Atlassian Team Aug 27, 2019

Hi @alamrezoanul ,

Can you kindly either paste the solution or the link to the thread in stackoverflow so that, in case, it can be useful to other users as well?

 

Cheers,
Dario

Like Andres LeonRangel likes this

It is very great that you have such a project. I am waiting for the time when we will transfer to electric passports. I think it will be easier in many ways. We won't have to go to the passport office to do them. Also, it is impossible to lose it, and you will have it always with you while your cellphone is with you, but we all know that forgetting your passport at home is more possible than forgetting your mobile phone. Also, I would like to have electronic driving licenses. Sometimes I can forget it at home, or in hurry don't bring it with me.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you