Forums

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

Getting a 401-Unauthorized Error on REST APi

Roman Melnyk April 15, 2019

Suddenly jira cookie based authentication stop working.

curl -D- -H "Content-Type: application/json" -c cookie.txt -d '{"username":"***", "password":"***" }' -X POST https://***.atlassian.net/rest/auth/1/session

 

It used to work previously, but now it returns 

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/2 401
server: Atlassian Proxy/1.13.6.2
www-authenticate: JIRA REST POST
www-authenticate: OAuth realm="https%3A%2F%2F***.atlassian.net"
cache-control: no-cache, no-store, no-transform
content-type: application/json;charset=UTF-8
strict-transport-security: max-age=315360000; includeSubDomains; preload
date: Mon, 15 Apr 2019 10:47:45 GMT
atl-traceid: c25b70cfb91d2b34
x-arequestid: adfb702c-282d-4646-a971-430ba45a1f0e
x-xss-protection: 1; mode=block
timing-allow-origin: *
x-ausername: anonymous
x-content-type-options: nosniff
set-cookie: atlassian.xsrf.token=BB6S-GXGL-849C-6HQC_dc36c2f633dfe5651d215ae87e331bfe50131bbe_lout; Path=/; Secure

100 119 0 46 100 73 95 151 --:--:-- --:--:-- --:--:-- 246{"errorMessages":["Login failed"],"errors":{}}

 

What could be the problem here?

PS. Using same creadentials works on Jila login page.

2 answers

1 accepted

0 votes
Answer accepted
Shunmuganathan M April 16, 2019

Actually they stopped the cookie based authentication. You can try to do another type of authentication

https://blog.developer.atlassian.com/app-opt-in-api-migration/

Roman Melnyk April 16, 2019

Yes confirmed that this is a feature:

https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth

The following Jira Cloud REST API endpoint will be removed:

/rest/auth/1/session

1 vote
Shunmuganathan M April 15, 2019

I am also getting same issue

{
"errorMessages": ["Login failed"],
"errors": {}
}

 

Is it JIRA server issue ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events