Trying to fix an old script that used Basic Auth to connec to JIRA.
I see Basic Auth is no longer supported.
I read the following but although the queries return 200, they return no data.
https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/
Here is the curl and output when using "-u":
curl -D- \
-u serge.prud.homme@erxxxxxn.com:COb....64A \
-X GET \
-H "Content-Type: application/json" \
https://NAME.atlassian.net/rest/api/2/search?reporter=serge.prudhomme
HTTP/2 200
server: AtlassianProxy/1.15.8.1
vary: Accept-Encoding
cache-control: no-cache, no-store, no-transform
content-type: application/json;charset=UTF-8
strict-transport-security: max-age=315360000; includeSubDomains; preload
date: Wed, 05 Feb 2020 13:22:12 GMT
atl-traceid: fbxxxxxxxxxxxxxx
x-arequestid: dfc1xxxxxxxxxxxxxxx8c3ea
x-xss-protection: 1; mode=block
timing-allow-origin: *
x-content-type-options: nosniff
set-cookie: atlassian.xsrf.token=BFK5-xxxxxxxxxxxxxxxxxxxxxxxx_lout; Path=/; Secure
{"startAt":0,"maxResults":50,"total":0,"issues":[]}
Same results if I try to create the header myself:
curl -D- \
-X GET \
-H "Authorization: Basic c2VyZ2UucHJ...2NSbWQ4OFF4TVAxbnJKS1AyNjRB" \
-H "Content-Type: application/json" \
https://NAME.atlassian.net/rest/api/2/search?reporter=serge.prudhomme
HTTP/2 200
server: AtlassianProxy/1.15.8.1
vary: Accept-Encoding
cache-control: no-cache, no-store, no-transform
content-type: application/json;charset=UTF-8
strict-transport-security: max-age=315360000; includeSubDomains; preload
date: Wed, 05 Feb 2020 13:23:37 GMT
atl-traceid: 70xxxxxxxxxxxxxx
x-arequestid: fa0a03xxxxxxxxxxxxxxxxxxx
x-xss-protection: 1; mode=block
timing-allow-origin: *
x-content-type-options: nosniff
set-cookie: atlassian.xsrf.token=BFK5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxt; Path=/; Secure
{"startAt":0,"maxResults":50,"total":0,"issues":[]}
Hi @Serge Prud'homme ,
Thanks a lot for pasting the curl output when executing the call.
By looking at it I can see that:
You can double check this by doing the following:
curl -D- -X GET https://NAME.atlassian.net/rest/api/2/search?reporter=serge.prudhomme
{"errorMessages":["Field 'reporter' does not exist or this field cannot be viewed by anonymous users."],"warningMessages":[]}
I hope this explains.
Also, I am going to edit your question in order to removed the sensitive data from there.
Cheers,
Dario
Thanks for pointing out this silly mistake. I was using to the wrong user (I'm using multiple user ids and got mixed up)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @Serge Prud'homme .
To be honest this happens to everyone that has multiple accounts, included me ;)
As a good practice, when searching via REST API fails, always try to log-into Jira as the same user and try to run the same search. This usually helps to narrow down the possible causes for the issue (wrong account, missing proper rights, etc)
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B Your answer was very useful. In my case, I have only one email but I was mistyping the email address domain!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @Jojo Thomas!
I am happy to know that after 2 year my answer can still be useful :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.