How to create avatar issuetype in JIRA Server using JIRA Server REST API oauth client?

Deleted user November 1, 2018

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#auth/1/session-login uses basic authentication and cookies, in curl, to create an avatar issuetype. However, I am not seeing an example using JIRA REST API oauth client. 

 

I have tried the equivalent of the curl command below using Java and successfully got the JSESSIONID from the response header.

 curl -c cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \
   -H "Content-Type: image/png" --data-binary @mynewavatar.png \
   'http://localhost:8090/jira/rest/api/2/issuetype/1/avatar/temporary?filename=mynewavatar.png'

 

However, when I add a cookie with the same JSESSIONID to the second request, it returned a 500 response code with the following message:

com.google.api.client.http.HttpResponseException: 500
{"errorMessages":["Uploading the avatar has failed. Please check that you are logged in and have sufficient permissions."],"errors":{}}

 

I also tried getting the JSESSIONID using basic authentication and passed the JSESSIONID to the second request....that worked.

 

Could someone please explain to me why basic authentication JSESSIONIDs work but JIRA Server REST API oauth client JSESSIONIDs do not? 

 

Thank you in advance.

1 answer

1 vote
Andrea Guarino April 1, 2019

Same here! Any explanation? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events