Forums

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

Why would the JIRA REST API return 401 unauthorized?

Nickolas_Kenyeres October 26, 2018

I have credentials for an account that I can use to login to the JIRA website but when I attempt to make a basic auth request to /rest/api/2/myself JIRA returns a 401 unauthorized response (the response is HTML). 

The issue is with an integration that works with any other account so I'm confident that its not an issue with the API request itself. 

For context, it's a JIRA Cloud account.

Are there any reasons, with JIRA or Atlassian account configuration perhaps, that the user would be unauthorized to use the API or access this particular endpoint?

2 answers

0 votes
Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 26, 2018

Just a guess here, but I wonder if the password for that account contains one or more problematic characters, such as a dollar sign? e.g.

$user = "bob";

$password = "abc$xyz";

PHP would try to substitute in a value for the non-existent variable $xyz.

0 votes
Thomas Deiler
Community Champion
October 26, 2018

Dear @Nickolas_Kenyeres,

how do you perform this request? With a Rest Client, own code, Library?

So long

Thomas

Nickolas_Kenyeres October 26, 2018

Hi Thomas, 

Thanks for the reply! The request is performed with code using the PHP Guzzle Library.

From a differential perspective, I can use other accounts from different JIRA Cloud accounts with the same code without issue. It's one particular JIRA Cloud account that always returns 401 unauthorized. 

Thomas Deiler
Community Champion
October 26, 2018

This means in general the PHP code works. Try to compare both accounts in depth. If there is no difference, I recommend to contact Atlassians support.

So long

Thomas

Nickolas_Kenyeres October 26, 2018

Thanks Thomas! Do you have any recommendation about which settings in particular to look for? 

Thomas Deiler
Community Champion
October 29, 2018

Dear @Nickolas_Kenyeres,

nop - you have to be investigative. Alternatively you can create another new account to reproduce the settings. Note every step.

Sorry, have no better hint for you.

So long

Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events