Forums

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

How to refresh the access token if it expires, in a server-to-server setup?

Tommaso Girotto
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!
December 5, 2023

Hello,

we have set up our backend to create and modify issues via Jira Cloud api and oauth2. We can successfully create the authorization_code, use that code to get an access_token, and use the access_token in the HTTP request headers to create and modify issues. We can also refresh the access_token successfully.

However, the refresh_token seems to expire after 10 minutes, and, in order to get a new one, we need to rerun the entire flow, all over again. This is not possible for us, because our client, since it's part of a server to server setup, cannot click the "accept" button on the authorization page that opens in the browser in the first step of the flow. Also, we do not want to have to refresh access_token and refresh_token every 10 minutes if we don't need to make calls to the Jira REST api. 

How can we get a new access_token/refresh_token pair without having to manually authorise, and without having to forcefully refresh the token every 10 minutes? In other words, how can we implement a 2LO flow to the REST api?

0 answers

Suggest an answer

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

Atlassian Community Events