Try this:
- go to Admin panel -> Settings -> System put the system in Offline mode.
- go to *Admin panel -> Emails -> Settings** change the default system emails and alert emails to something else.
- go to Admin panel -> Emails -> Emails
make note of the settings and such that you used in this page.
delete the email that you setup OAuth2 with. - go to Admin panel -> Manage -> Plugins
disable the oauth plugin.
delete the plugin - re-download the oauth plugin from osticket.com/download
- re-install the plugin.
- configure the plugin.
- go to Admin panel -> Emails -> Emails
Add a new email.
re-setup the email you deleted earlier - go to *Admin panel -> Emails -> Settings** change the default system emails and alert emails to the newly re-setup email
- go to Admin panel -> Settings -> System put the system in Online mode.
these two links should help you setup the OAuth plugin.
https://forum.osticket.com/d/96893-basic-authentication-retirement-for-legacy-protocols-in-exchange-online/138