Forums

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

Why return 200 [] on GET /rest/api/3/project when not logged in

Jens Bjerre
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!
October 5, 2020

Is there a reason that Jira returns 200 empty list when no user is logged in? Wouldn't 401 be a more appropriate response code?

Some libraries rely on the response code being correct to do transparent authentication but they cannot guess that this 200 [] is actually a 401, case in point OkHttp.

2 answers

2 accepted

1 vote
Answer accepted
Pritam Kumar
Contributor
October 5, 2020
1 vote
Answer accepted
Niranjan
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 5, 2020

Hi,

Not sure but what I could think of is that the code 200 indicates that the request has succeeded. It may or may not return empty results. There may be projects that can have open access (which may not need authentication) and in such cases it is not about authentication. While the response 401 code says that the request is not complete as it needs authentication, but doesn't have a valid one.

Suggest an answer

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

Atlassian Community Events