Edit: Ignore my post. The problem was the certificate was expired.
Sorry for posting in an old thread. I'm experiencing the same issue. I think logging with the Microsoft login button on the scp section works as long as you haven't logged in on the "customer" portal (with the Microsoft button). I didn't experience problems until I logged in to that part of the site.
I'm running osTicket (v1.18.2) + Oauth2 plugin v0.6 on Apache with php 8.2.29