KevinTheJedi
Hello Kevin,
I followed all the steps in your "https://forum.osticket.com/d/105728-ms-oauth2-error-the-api-version-v2-has-been-depreciated/242" but every time I am being redirected to the support ticket main page once I am providing the email credentials, not getting the popup to consent and hence no token renewal and no success page.
Can you provide some help please.

everything was working fine till Saturday and since then its down.

    ssalehahmed2

    Then you are not doing something right. Please follow the guide here step-by-step:

    Once you get to the Outlook Scopes field replace the default value with this: offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send

    Then when you submit the popup and go to microsoft, you login as the email you are configuring in osTicket. Then you consent to the permissions and you should be good. If you have to request consent from an admin this will not work. Your admin will need to consent on behalf of the org in the enterprise applications or allow users to consent themselves.

    Cheers.

      I recreated the whole email but again same thing. after updating the OAuth2 plugin, I am not getting "resource detail" and "email address attribute" is there something i am missing

      5 days later

      KevinTheJedi

      I have tried this for the error
      array ( 'code' => 'Gone', 'message' => 'The API version \'V2\' has been deprecated.', )

      Update the callback() method, run this caommand inside plugin directory "php -r '$phar = new Phar("auth-oauth2.phar"); $phar->extractTo("./auth-oauth2");" , update the table ost_plugin install_path to plugins/auth-oauth2 and ispher 0.

      Still the error persistent. osTicket (v1.18)

      Anything else to try please ?

        No-U-turn

        No longer need to do that. Simply revert the changes you made, download/install the latest plugin, and follow these instructions (if updating an existing email in osTicket follow instructions in the Attention notice at the top).

        Cheers.

        10 days later

        KevinTheJedi

        Just to note, a new set of releases for both 1.17.x and 1.18.x will be released soon that will contain the above core codebase patch.

        when ?

          6 days later

          Hello,

          I have updated the OAUTH2 Plugin, altered the source code files as requested, and everything authorizes correctly. The Oauth authentication works and no errors pop up.

          However, When I send email nothing happens. It looks like the email should send fine, no errors, but I don't recieve any email sent.

          Also, It's not fetching any emails from our helpdesk box so thus not creating tickets.

          Any ideas? I've already tried deleting and recreating the Oauth2 in Azure and like I said, no errors.

            5 days later

            I have updated the plugin, but after making the code changes my instance stops working as I get an error message when I visit the site. This is when the class.oauth2.php file has been modified. Replacing it back with the old causes it to function correctly (well able to reach the site again).
            I am 1.18.1 and used the latest plugin update was done from 1.17.3 in effort to solve.
            After reverting to prior versions of patch (remaining on 1.18.1):
            I am able to send mails, but it is not able to fetch - no errors listed that I can find.
            Clicking save changes on my email account, I end up with an error:
            Unable to update this email. Correct any errors below and try again (no errors indicated).
            on the outgoing SMTP this error is displayed:
            5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information.[rest omitted]

              JBluesOH

              You no longer need to do that. We released an updated build of the plugin on our download page a while ago. Simply download the new build and install it. Then simply follow the steps listed in the attention notice at the top of this page:

              Cheers.

                KevinTheJedi Thank you sir. It is working, for some reason my mail fetch stopped collecting. This was due to task no longer running I guess. I reset up a task to use cron.php and I am now receiving the mails into my helpdesk system.

                15 days later

                @KevinTheJedi
                Hi friend, this week the emails on my sticket stopped and I came across this post, I use business outlook with my own domain, I've already done the step-by-step instructions you gave above:
                Downloaded the new build of OAuth2 plugin from the osTicket download page.
                Replaced your existing auth-oauth2.phar file with the new one.
                You've made these changes in your code.
                You've restarted your web server (and PHP-FPM if you're running it) to clear any server-side file caching. If using a hosting provider they will likely have additional file caching and if that’s the case reach out to ask how to clear said cache.
                Opened an incognito/private window.
                Navigated to your system email in osTicket.
                Clicked Remote Mailbox and clicked Config.
                Deleted the existing token (if one)......

                However, when I log in to the email it redirects to the osticket support home page, the pop does not appear for me to authorize and generate the token,
                I'm currently running osticket in a docker with ngix, I've already restarted the container and it has nginx, but I still have the problem.