TBCS2
You need to upgrade to v1.17.3 and install the latest build of the OAuth2 plugin from our website. This was an old bug that has already been addressed.
Once you upgrade osTicket and update the OAuth2 plugin login osTicket in an Incognito/Private/InPrivate window (this is to avoid authorizing the wrong account - this step is crucial), go to the email in question, click the Remote Mailbox tab, click Config next to Authentication, click the Token tab, click Delete Token, confirm the deletion, click Submit on the popup, login as the email you are trying to get a Token for, click Accept, and you should then be redirected back to osTicket with a new Token. This token will now be refreshed automatically and should not expire until the Client Secret expires.
Explanation of the issue:
With v1.17.2 and older builds of OAuth2 plugin, there was a bug where we were not updating the Refresh Token. So, after 90 days the Refresh Token would expire and the tokens will no longer work. In v1.17.3 + latest build of OAuth2 plugin, we now update the Refresh Token along with the Access Token and this prevents either from expiring.
Cheers.