jbeaudion

404 is "Not Found" error and means the URL could not be found on your webserver. We've seen issues with IIS and URL Rewriting so there are a few threads on this already. A community member even posted his webConfig to show what's needed.

Cheers.

    KevinTheJedi
    You were dead on, I needed to fix my URL rewriting in the IIS manager and it worked like a charm right after.

    @jbeaudion

    Can you please share what you had to do in order to address the issue? It’ll help others who may run into this in the future.

    Cheers.

      jbeaudion

      I went through and re-tested this with Windows Server 2016 (all I got for now) and I see how this issue can occur. So we do ship with web.cofig files in the codebase. This is fine and all but if your IIS webserver does not have the URL Rewrite module installed/enabled then these configs will not be read/executed. So if you are using IIS and getting 404 when redirecting back to osTicket you simply need to install/enable the URL Rewrite module for IIS, restart IIS, and retry.

      I was also able to confirm that you do not need to manually add custom rewrite rules as we ship with web.config files so all you really need to do is install/enable the rewrite module and restart IIS and you are set!

      Cheers.

        KevinTheJedi That explains a lot, because I basically "stole" those rewrite rules from my instance that did work, but I had no idea how they got there to begin with. 😅

          jbeaudion

          I'm a complete IIS noob so I totally didn't realize that my instance already had this module installed so I couldn't replicate the issue. But after I saw your post I was like hmm let me check and sure enough it was already installed and reading the web.config so that's why mine was working already. Glad everything was worked out and it's not too big of an issue 😅

          Cheers.

          2 months later

          UnderDogMiller

          Well that error says otherwise. 404 means not found which means the url isn’t being rewritten.

          Cheers.

          Correct - the 404 error didn't change after adding the Rewrite tool. However - the rewrite tool is working to REDIRECT (not rewrite) http to https redirects. Thus, I am missing something. I saw a previous post where someone had inserted all the custom rules for the rewrite. I guess I am not sure how to troubleshoot the rewrite tool to ensure it is rewriting URL's. Here is my redirect rule that works for http to https:

            I'm getting closer - now instead of the 404 error I get: URL not supported.

            I'm going to drive myself insane...and probably you guys too.
            I decided to remove the plugin and start from scratch...but now I get a blank banner when configuring the OAuth2 (clicking the "config" button) as shown here:

              UnderDogMiller

              Look at 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.

              UnderDogMiller
              When this happened to me I had to totally delete the email and then re-add it. In my case it was the "Default" email account, so I couldn't delete it until I set a different email as the default in "email > settings". If that fails you'd have to delete the entry in the database for the email account with phpmyadmin or something similar to make it easier to find the entry.

                jiggs - thanks that helped me get things back - but now I still get the "URL Not Supported" message after clicking submit and authenticating with our 365 account. I'm using the email account credentials for the email address that I'm working with.. It is the Redirect URI field... the very first field that contains: https://support.company.local/api/auth/oauth2. When I put this into Chrome - it says: "URL Not Supported."

                  UnderDogMiller

                  URL Rewriting is not enabled or not working in your instance. You will need to search online on how to enable this in your environment (it differs depending on the server and setup).

                  Cheers.

                    KevinTheJedi - thanks for the quick reply. It does seem like the rewrite is working because the "URL Not Supported" is not coming from IIS or the client browser, but from the class.dispatcher.php code in the include folder.

                      UnderDogMiller

                      I see, read that wrong, thought it was "not found". That typically means the URL you are attempting to visit can’t be found in the available rules. The rules are setup in the plugin and should be working properly. If not then something deeper is going on.

                      Cheers.

                        KevinTheJedi How do I find the rules? This is what I show in our Plugin setup for OAuth2 - under the Config tab:

                        Also - my comment from earlier about responding so quickly was meant as a compliment. I know you are not obligated to answer me in a timely manner or even at all. So I am super appreciative of the timely and thorough responses from you and all the community members!