Well that error says otherwise. 404 means not found which means the url isn’t being rewritten.
Cheers.
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:
You can take a look at
https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules?source=recommendations
https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/testing-rewrite-rule-patterns
This one works for you, in case you want to double-check:
https://howtohelpdesk.com/how-to-redirect-http-to-https-in-iis/
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:
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."
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.
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!
I don’t know how that happened, that last part was meant for another thread entirely. My apologies. I edited my previous reply to remove that part. Someone else was being rude, not you lol
The rules are registered in the plugin code itself. You can see it here:
So it’s looking for "/api/auth/oauth2".
Cheers.
KevinTheJedi Well and that is what I have in the URL. So - as you said, it seems like something deeper is going on {sigh}.
Make sure the files aren’t corrupted somehow, make sure your webserver is not blocking the URL or mangling it, check your server logs to see if anything is being logged, etc. I would also make sure your registered app in azure has the correct url configured.
You can also try downloading the raw plugin files from GitHub, uploading the raw auth-oauth2 folder to your plugin folder, moving the phar plugin outside the plugin directory, going to your database.ost_plugin table, set isphar to 0 for that plugin, and retest.
Cheers.
OK - I'm revisiting this now that PHP is configured and working correctly. I tried the settings again and it still returns with "URL not supported." I'll keep digging but let me know if you have any insight.
Honestly I had a really hard time trying to get IIS working with PHP 8+ and gave up.
After over 10 years of running osTicket under IIS, I switched to Apache.
I figure that is not the answer that you want to hear, but you might want to consider the option.
ntozier Yeah - not a great answer. There has to be a solution.
Well I can say that MS decided to kill windows builds of PHP (a month or so ago - maybe earlier) so everything with PHP is almost completely manual now in IIS. So if you aren't familiar with IIS and PHP inter-workings then you are pretty much at the mercy of guides online. Not as easy as it used to be with auto-installers, etc. With this being said people are seeing no choice but to switch to Linux as the PHP integration out of the box is simply superior now and much, much easier.
Your issue a very odd issue that I cannot replicate and I haven't seen elsewhere. Have you tried a completely different browser to see if your usual browser is caching something? Also, make sure the Callback Endpoint in the OAuth2 popup matches the Redirect URI in your App Registration.
Can you try var_dump
ing the URL in the Dispatcher to see what the actual URL the application is trying to match on so we can see why it's failing to match?
Cheers.
KevinTheJedi Yeah - we are caught in the middle right now...
We are not Linux gurus so thus we opted to go the Windows route for osTicket... What I'm wondering now is, maybe we try Apache on Windows instead of using IIS. We might have better results that way. We understand the underlying OS when it comes to Windows vs Linux...
And yes, we have tried multiple machines, multiple browsers...
But yes, the callback and redirect URI match. I will dig into the var_dumping of the URL... but we don't know how to invoke that. Any hints?