DEV Community

nikhil nautiyal
nikhil nautiyal

Posted on

API timeout when accessToken expire and passport.js fetch new access token

I have a implementation where express-request-proxy is within adapter.authenticate('main', { session: true }, function(err, user) {//here I have express-request-proxy}
Access_token_expiry is set to 5 mins and sso_Idle_max is set to 30 mins in IDP.
Once you login all call get proxy via authenticate('main') method. this works fine between 1-4 mins of session as during this time authenticate method approve the requst using cache but the moment the time reaches to 5 mins or 5+ the autheticate('main') method goes to IDP to get a new access_token. the token is received but express-request-proxy gets timeout error.

Any recomendation on this ? Is there any issues with using express-request-proxy inside authenticate('main') ?

Appreciate your help in advance

Top comments (0)