As soon as I re-enter the secret and save changes emails flow again for 60mins.
aburtenshaw Yes, I have written this for my own reference, so I can make changes to doc as needed You might be missing email fetch https://howtohelpdesk.com/how-to-setup-oauth-on-osticket-using-microsoft-365/#Fetch-emails
Thank you again, though I am sure the email wouldn't collect for the first 60 mins if the fetch were misconfigured. Also, basic authentication works with no problem.
Well, I seem to have broken osTicket while trying to get OAuth2 Authorisation working. When I click submit on the OAuth2 Authorization IdP Config screen, it hangs on loading. No sure how I manage that.
aburtenshaw
Check your logs for any related errors.
Cheers.
aburtenshaw I sorted it by deleting the email and recreating the email.
I deleted all config locally and on 365, and the token refreshed a couple of times, but then it failed to refresh again.
I pressed submit, and the token refreshed.
I am out of ideas.
Is there a way you can track network traffic to see if something is happening when refreshing the token?
I don't even know of a way to track when the token is being refreshed.
When the email is used at all to fetch or send we first check the token expiration and if expired we call MS with the current refresh token and access token to get new ones. Maybe MS has some logs that should show you tokens being refreshed? Also, if you track your network requests you should see requests going to MS to get new tokens.
I continue to search logs for more information. What does the submit button on the OAuth2 Authorization screen do that running the cron.php doesn't, as the submit button refreshes every time without fail, whereas the cron.php does not?
It does the same thing if you already have a token. If you don’t have a token or you change the info then it re-authorizes.
So as I just click the config and confirm to refresh the ticket it must be authorisation that is the problem.