Access Jira Rest API using Azure AD Oauth2

Yann Herren July 26, 2021

Hi

I'm trying to make REST calls to the Jira company instance. The authentication is done using Azure AD where other Azure resources are requested as well. In Azure, the administrator connected the Atlassian Cloud Service, so that the registered app has the appropriate app permission.

When acquiring a token from Azure, the application requests the resource or scope "https://id.atlassian.com/login/user_impersonation" which works fine.

However, if I'm now trying to call the Jira Rest API with the generated token the response is: 

{    
"message": "Client must be authenticated to access this resource.",
   "status-code": 401
}

Obviously, something is wrong with the token. I already tried different scopes but I couldn't come up with a solution. Furthermore, there was no up-to-date guide covering this topic I could find.

Thanks in advance for any help. 

1 answer

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 28, 2021

Hello @Yann Herren ,

Welcome to the Atlassian Community!

I have some difficulties understanding what you are doing and what you are trying to achieve. Can you kindly try to reformulate?

 

In any case, you may find the answer to your question in the Security overview page on developer.atlassian.com. In there you can find the list of all the different ways to authenticate, depending on your needs:

Security is implemented differently, depending on what you are building:

 

Please review above page and let me know if it helps.

Also, I have moved this question to the Marketplace Apps & Integrations section in order to increase your chances to get help from other community members too.

 

 

Cheers,
Dario

Yann Herren July 28, 2021

Hi Dario

 

Thanks for your response. Of course I can.

Our application currently uses Azure Active Directory for authentication. It's going be a web application later on where you should be able to sign in using a "Continue with Microsoft" button. Now as you (Atlassian) offer that option on your website as well, I was wondering if I could use Azure AD to authenticate with your Jira REST API. I haven't found much on the internet or in your documentation covering this topic - maybe I overlooked something. What I'm basically trying to avoid is that the user has to login or gets prompted multiple times before the application can be accessed.

 

I'm sorry for being unclear but I hope this time my description is a bit more accurate.

 

Best,

Yann

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

Hi @Yann Herren ,

Thanks for clarifying, everything is crystal clear now but I am afraid this might not the best place to get help on development related questions.

 

I strongly advise to ask the developers community instead :) 

 

Have a nice day!

Dario

Yann Herren July 28, 2021

Okay, will do :)

Thank your for help and the quick responses!

 

Best,

Yann 

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

You are very welcome @Yann Herren , I wish I were able to be more helpful.  :) 

Suggest an answer

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

Atlassian Community Events