Forums

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

Jira REST API download attachments redirect to a login page

Dina Abezgauz June 17, 2020

I have an electron app where users login in to their JIRA accounts using OAuth 2.0

I create a GET request to /rest/api/2/search with Bearer authorization token to get the issue list.
From the issue metadata I get the attachment content url and make a GET request to /secure/attachment/{id}/{filename} (without Bearer authorization)

Sometimes instead of the redirection to the attachment file I get an redirection to a login page.
I think it could be because of expiration of cloud.session.token cookie (the expiry date is setting to now + 1 month)

If I delete cloud.session.token manually and repeat my flow: request to /rest/api/2/search with Bearer authorization token, then request to /secure/attachment/{id}/{filename} I get the same results (redirection to a login page)
How can I prevent such behavior?

Thanks.
Regards.
Dina.

1 answer

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2020

Hello @Dina Abezgauz ,

Before going any further, let me mention that this is not the best place to get support on development related topics and that I might not be the best person to answer this question. The right resources are listed in https://developer.atlassian.com/resources.

Specifically:

 

However, what you are describing could be related to the issue discussed 5 days ago in the Developers Community:

 

The above thread resulted in the creation of the following bug ticket: 

 

Please review above links in order to check if you can find anything useful in there. In case they don't help I would advise to create either a new thread in the Developers Community or a new Developer Support Request.

 

 

Cheers,
Dario

Suggest an answer

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

Atlassian Community Events