OAuth 2.0 Token getting expired during the API call process
Hello,
We have some Connect-REST that use Authentication Profile to a Custom OAuth 2.0 Provider that generate token valid for 600 seconds.
It appears that less than 1% of the call return a 401 unauthorized response.
The issue is that when Pega checks whether an oAuth token already exists and if it is valid then it sends the token while calling the API, even if it is only valid for 1 sec.
So Pega check and find it's valid, call the API with this token, but once it reach the service, it says it's now expired.
Is there a way to prevent this or any OOTB settings / thing that we can do to renew the token when the validity is less than X seconds ?
We haven't find anything in the documentation or any response in a similar topic
https://support.pega.com/question/oauth-access-token-getting-expired?
Thank you.