Atlassian Connect Spring boot JWT expiration

I’m making authenticated requests back to the add-on from within the iframe after a while the next request return JWT expired any solution ? thanks

Hi @AmineMekki1,

Hello and thanks for your question. Maybe some example code might help? JWTs have a timeout, so if you’re saving the token before your loop then you might see this happen, for example if you have

let token => AP.context.getToken(token)

and then have a loop where you call with fetch() and

                        headers: {
                            'Authorization': 'JWT ' + token

then yes, the JWT will timeout.

You’ll need to refresh the token.


Hi @jrichards ,
Thank you for your response, yes i’m using the token like you described so how to refresh it ? and is there another solution ?


Hi @AmineMekki1,

Just move the token request into the loop, and request a new one when it fails, or keep a timer associated with it and request a new one when the time is exceeded.

Maybe if you post some example code we can check your design.


Hi, @jrichards ,
right now i added a timer that get a new token thank you for your help.

1 Like