As you all know, Microsoft disabled Basic Authentication as of this month.

Thus, I've updated my site to 1.17 and installed the OAuth2 plugin (downloaded yesterday from the OSTicket Website).
I tried to configure the adresses to fetch mails as before and each time ended up on a 404 while the redirect URI sent me to the default redirect that I copied in Azure from OSTicket : https://osticket.mydomain/api/auth/oauth2

So Azure validated my login (with the same account I was configuring on OSTicket) but still did not fetch the mails and not changing the state of the fetching setting in the "Remote Mailbox" tab.
Also when I try to configure it to try again now, I get a blank popup with Internal Server Errors:

Here is also my Dashboard information tab :

Thanks for your help

    ADRD

    For the 404 URL Rewriting is not enabled on your server. Google how to enable this for your server.

    As far as the white/blank popup, try deleting the email entirely and re-adding it.

    Cheers.

      KevinTheJedi

      Hello,
      thank you for your suggestions, I've checked the URL Rewriting as you mentionned, so I added 'RewriteEngine On' on top of my .../include/.htaccess (which was the only .htaccess file without it), hope that will do the trick, we'll see when I can try and configure it again.

      About the blank popup, I deleted the email and recreated it - even tried with a different name - and it still comes blank.
      The error is gone, and I now have this message in chrome console :

        ADRD

        That has nothing to do with the issue. You'll need to check your logs (general server logs, webserver error logs, PHP error logs, MySQL/MariaDB error logs, osTicket System Logs, Browser Console logs, etc.) for any related errors.

        Cheers.

        Hello again,

        So I checked which log files were affected when triggering the form for the Auth configuration. It looks like it's the /var/log/httpd/ssl_error_log and shows the following error :

        [Fri Oct 14 10:14:14.706167 2022] [php:error] [pid 2091] [client <my_computer_IP>:59183] PHP Fatal error: Uncaught Error: Call to a member function setConfigClass() on null in phar:///var/www/<mysite>/html/include/plugins/auth-oauth2.phar/oauth2.php:592\nStack trace:\n#0 phar:///var/www/<mysite>/html/include/plugins/auth-oauth2.phar/oauth2.php(405): GenericEmailOauth2Provider->getPluginInstance()\n#1 phar:///var/www/<mysite>/html/include/plugins/auth-oauth2.phar/oauth2.php(417): OAuth2ProviderBackend->getConfig()\n#2 /var/www/<mysite>/html/include/class.email.php(567): OAuth2ProviderBackend->getConfigForm()\n#3 /var/www/<mysite>/html/include/class.email.php(631): EmailAccount->getOAuth2ConfigForm()\n#4 /var/www/<mysite>/html/include/ajax.email.php(23): EmailAccount->getAuthConfigForm()\n#5 /var/www/<mysite>/html/include/class.dispatcher.php(151): EmailAjaxAPI->configureAuth()\n#6 /var/www/<mysite>/html/include/class.dispatcher.php(38): UrlMatcher->dispatch()\n#7 /var/www/<mysite>/html/include/class.dispatcher.php(120): Dispatcher->resolve()\n#8 /var/www/<mysite>/html/include/class.dispatcher.php(38): UrlMatcher->dispatch()\n#9 /var/www/<mysite>/html/scp/ajax.php(326): Dispatcher->resolve()\n#10 {main}\n thrown in phar:///var/www/<mysite>/html/include/plugins/auth-oauth2.phar/oauth2.php on line 592, referer: https://osticket.<mydomain>/scp/emails.php?id=4

        I also already tried to remove and reinstall the plugin, it still does the same.

          ADRD About the blank popup, I deleted the email and recreated it - even tried with a different name - and it still comes blank.

          As mentioned earlier, I did that already - serveral times - Without any result.

            ADRD

            Then I’d recommend logging into the database and deleting any plugin instances related as well as any config table items that are related (namespace of email.ID.account.ID).

            Cheers.

            KevinTheJedi Dear Kévin,
            Thanks for your help.
            I have the same issue (404 not found) but I m using php manager in iis.

            How should I configure URL rewriting in this context?

            Tks,

            Br

            Tfrere

              Tfrere

              IIS isn’t loading the web.config then. Try to get the web.config to load or if all else fails you can add the rewrite rules to IIS manually.

              Cheers.

                KevinTheJedi ok, I have added URL rewrite module in iis.
                But now, which rules should I write?
                Also, should I add an API (osticket manage api)?

                Tks!

                  Tfrere

                  You don’t have to add any rules if your web.config (shipped with the code) loads properly.

                  Also, no you do not need to add an API.

                  Cheers.

                    KevinTheJedi effectively, I have removed web.config and regenerate it automatically with iis otherelse the site doesn't works (ERROR 500). It is probably the cause.
                    So I will try to use the web.config provided by default.

                      Tfrere Kevin, well done!
                      I have restored the web.config and select the php version in php manager (iis).
                      Now I have an another error (curl error 60: SSL certificate problem)

                      But it s an another error, I will investigate before asking a lot of questions!

                      Tks for your availability and your perfect advices!

                      Cheers,

                      Tfrere

                        Tfrere

                        There are other threads on the certificate error but in short you need to download the official cURL certificate and configure your PHP instance to use this. You can look online to see exactly how to do this, it’s very simple luckily.

                        Cheers.

                        Tfrere

                        I forgot to ask, is there anything special you need to do to load the web.config on IIS? If so, please post instructions if you would be so kind so that others can see how to resolve this. A few people on the Forum have ran into this and some still can’t figure it out.

                        Cheers.

                          KevinTheJedi Dear Kevin,
                          To resume:
                          To upgrade to osticket 1.17:

                          • download php 8
                            -download osticket 1.16 with plug-ins that you are using.
                            -copy osticket 1.16 "upload " folder(don t forget to copy also the recently downloaded phar files in include/plugins folder!!!! otherelse you will receive error 500)
                          • go to iis php manager of the osticket site and register the new php folder (8 phpcgi.exe)
                            -upgrade to 1.16 via the wizard on your osticket website.

                          Do the same to upgrade to 1.17.
                          Finally to configure Oauth2 please follow the documentation available on osticket site.

                          My issue, was because in the beginning I didn't copy the phar files. So I got error 500. To avoid this error I have removed the web.config on the osticket folder then I went to php manager and it regenerate the web.config. so the url rewritting indicated in the initial web.config from upload folder wasn't present.

                          To resume: copy the entire "upload" folder and the new phar files. Go to php manager to register the new php version and apply the upgrade. That s it.

                          For the error 60, I have followed those instructions:

                          https://medium.com/@narendravaghela/how-to-fix-curl-error-60-ssl-certificate-problem-80e7dafafa57

                          Now all is working perfectly!

                          Thanks a lot for your support.

                          Cheers,

                          Tfrere

                          ADRD I had the same issue with the pop up.
                          I finally restore my database with a backup that I made before installing the plug-in.

                          Br,

                          Tfrere

                          • ADRD replied to this.

                            Tfrere

                            Thanks, I restored a previous version, reinstalled the plugin and it's working better.

                            @KevinTheJedi The URL rewriting enabling seems to have done the trick too.

                            I'm still having failed authentication but that's more likely a configuration issue on my side.

                            4 months later

                            @KevinTheJedi We are getting mime emails sent back to us, OAuth2 does not seem to be working. it is fine for remote mailbox but not outgoing. our configurations are correct as we have followed the guide by osTicket. When trying to enable the status we keep on getting errors.