Everyone,
Thanks to the wonderful @rblake we now confirmed a working setup with Microsoft and OAuth2! Below are the settings you'll need.
Go to the Azure Portal > App Registrations and create a new Application. Set the Supported account types to Multiple Organization (if available) and set the Redirect URI > Platform to Web and set the actual URL to the one provided by osTicket. Now go to the Application and API Permissions > Microsoft Graph > Delegated Permissions. Here you will add email
, openid
, profile
, User.Read
, offline_access
, IMAP.AccessAsUser.All
, POP.AccessAsUser.All
, and SMTP.Send
. Once added make sure you Grant Admin Consent to the scopes.
Now you can go to App Registrations > click the App > and click Authentication tab. Here you will enable the options Access Tokens
and ID Tokens
and Save the changes.
Next you will need to create your Client Secret so click the Certificates & Secrets tab. Click New Client Secret and create a new secret. Once you have this copy the secret and save it somewhere. Now you need to get your Client ID so go to the Overview tab and copy the Application (client) ID and save it somewhere.
Next, you need to get the correct endpoints so click Overview tab and at the very top you should see and Endpoints blade. Click this and you should see the correct OAuth 2.0 authorization endpoint (v2) and OAuth 2.0 token endpoint (v2) endpoints. Copy these and save them somewhere.
Lastly, we need to configure osTicket so go to the email in osTicket, select OAuth2 - Microsoft, and click Configure. Now you can enter your Client ID, Client Secret, keep the scopes as the defaults, set your Authorization Endpoint to the one you saved earlier, set your Token Endpoint to the one you saved earlier, keep Resource Details Endpoint as default, change Email Address Attribute to EmailAddress
, and click Submit.
Once you click submit you should be redirected to login. Make sure you are logging in with the correct account. Once you login you may be met with a consent screen so consent and when redirected back to osTicket you should have successfully received a token. You can verify this with a successful green banner and clicking Configure again and see a Token tab. Once you have a Token you should be able to enable IMAP (or POP) and save changes.
Edit:
MS finally fixed my developer account issues and I was able to confirm the above works for me as well! So glad we were finally able to confirm MS as a provider! We are so close to releasing stable! We have a few bug fixes and we are adding PHP 8.1 support so expect at least an RC4 and a new build of the plugin soon. Shortly after v1.17 stable should be ready!
Cheers.