Forums

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

Jira Oauth REST API - renew expired acces Token

Miriam Bermudez
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!
February 26, 2018

I have already made a successful connection using Oauth following the next tutorial: https://developer.atlassian.com/server/jira/platform/oauth/

When I make a POST request base_url/oauth/access-token, it retrieves me the following body:

{

'oauth_token_secret': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
'oauth_session_handle': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'oauth_authorization_expires_in': '160272000',
'oauth_token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'oauth_expires_in': '157680000'

}

My question is what the numbers of the *_expires_in fields are: Timestamp? Miliseconds? (If it is Timestamp, it doesn't make a lot of sense cause it refers to the century before)

I made some research and I found out that all access tokens expires in 7 days if I am correct. So what are those fields (*_expires_in) referred for?

Furthermore, Is there any way to renew the access-token? like for example with Oauth2 there is the refresh-token to do it. Or it has to be always every 7 days manually?

Finally my last question, is there any new new that Jira will support Oauth2?

Thanks.

2 answers

0 votes
Azfar Masut
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2023

Is there any way for us to change the length of the token expiry? ('oauth_expires_in': '157680000')

5 years is a crazy long time. And I cant seems to find any docs explaining on how I can modify this. Any help would be much appreciated

0 votes
Pragatheeswaran
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!
August 16, 2018

Hi even i had doubt on this, but up-to my research, its saying expires_in with means it will expire after then seconds that's given there. 157680000 is 5 years. I think it will expires in five years. oauth_authorization_expires_in is also ~5 years. i don't know what is the difference between both of them

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events