Should be, yet no dice. Are you able to confirm what the URL should come back as for a working instance? I can only get it to redirect to the portal without changing how the rule is written.
OAuth2 Microsoft Not Working
The URL should be correct it's just your webserver is not rewriting the URL to match. Once it's rewritten it should have http.php
in between /api/
and /auth/
so /api/http.php/auth/oauth2?blah_blah
.
Cheers.
Thanks, just trying to keep myself from going down the wrong rabbit holes.
Thank you again for your patience. It ended up being the YOURLs rewrite rule I had referenced prior had priority and had a wider scope, thus matching the redirect URI. Sending that URL rewrite rule to the bottom so that the API rule is processed first did indeed solve my issue.
So, of course, Azure Web Apps running Linux/PHP don't use the web.config file, and have recently started using nginx as the webserver technology... I don't suppose anyone has the rewrite rules specified in the web.config in nginx format?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<rewrite>
<rules>
<rule name="HTTP api" stopProcessing="true">
<match url="^(.*/)?api/(.*)$" ignoreCase="true"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile"
ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory"
ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}api/http.php/{R:2}"/>
</rule>
<rule name="Site pages" stopProcessing="true">
<match url="^(.*/)?pages/(.*)$" ignoreCase="true"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile"
ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory"
ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}pages/index.php/{R:2}"/>
</rule>
<rule name="Staff applications" stopProcessing="true">
<match url="^(.*/)?scp/apps/(.*)$" ignoreCase="true"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile"
ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory"
ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}scp/apps/dispatcher.php/{R:2}"/>
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Someone posted their NGINX config in one of the threads. You'll have to search around to find it.
Cheers.
I cannot for the life of me figure out how to make my test 365 email account be able to automatically consent to add the app when prompted. Every time I am prompted to submit for consent. And when I select "return to app" after requesting consent, it starts all over when I try again.
I even tried making app consent wide open for all users, and it still sent this up for admin consent. I have granted admin consent under the app config and in Enterprise Applications.
Can someone help me get over this hump - do I need to assign some admin role to the test user?
Just thought I'd throw my findings in the ring here. I updated OsTicket yesterday and setup the Oauth plugin. We had the issue where an agent signs in, and it redirects to the homepage. I knew it wasn't a problem with the setup as it worked fine for me, and at least one other agent, just not the rest. I checked the email fields matched up and was stumped otherwise. As a last resort, I went to assign the user a password so they could login locally. They were told they had maxed out their attempts so I thought I'd solved the issue! I changed the maximum attempt fields and the user then got an "Access denied" message. I went to the user account and changed it from "Use any available backend" to "Local authentication". User could sign in. Then I thought I wonder what happens if I change it to use "Microsoft" authentication, and then it worked!. The strange thing is, everyone is setup to "Use any available backend" and as I said, it works for at least 2 of us.
We previously used the LDAP plugin and whether this had some kind of effect on things, I don't know. It was disabled before I changed the authentication over anyway. Hopefully this might help other people who are in my position!
Chief_Slack
This might help, I had that issue, you have to give Application administrator to your support email address
https://howtohelpdesk.com/how-to-setup-oauth-on-osticket-using-microsoft-365/#allow-user-Consent
- Edited
Hi kevin thank you for all the effort you puts in this forum , i have a problem with enabling IMAP or POP
For POP see the below pull:
You can either "upgrade" to 1.17.x as described here, make the changes manually, or wait for the next release (no set date).
Cheers.
KevinTheJedi
my dear thanks for your keep nagging for my issue , but because i have to deliver a working Ticketing system to my Management , everything works fine so far but only the mail fetching still not operational .
i already have the 1.17 release installed
You are using RC4 which has bugs and is not the "stable" release of v1.17. You will need to follow my instructions in my previous post.
Cheers.
Hi Kevin,
I'm having a similar issue with this. I am getting /api/auth/oauth2
rather than /api/http.php/auth/
when clicking "Sign in with Azure"
I've followed the wiki guide for setting up oauth for agent login & gone through this thread and others to try and make sure I haven't made a mistake anywhere.
The web server is apache with rewrite enabled. I've tested that rewrite does work by temporarily adding a different rule to the .htaccess in the api folder. The rule was a rewrite from api/foobar/ to www.example.com & that did trigger.
Azure is showing the log in attempts as successes.
Thanks for any help or guidance you may be able to provide.
You'll have to create your own thread with detailed info, screenshots, and steps. /api/auth/oauth2
is the correct URL.
Cheers.
I got the token right now.
But when i click enable and save changes for outgoing mail it says this
So when i test outgoing mail it says the test was successful but it wasnt
Where can I see my logs or how do I troubleshoot whats going on if im using centos with cpanel
You’ll need to contact your hosting provider. It’s likely they have restrictions on outgoing SMTP connections or a firewall, etc.
Cheers.
Cheers,
I am having a problem with OAuth2 that i can´t understand...
Can you help me please?
The error is
AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption.
What am i doing wrong?
I don’t think I’ve ever seen that error before. Make sure you are following the documentation here:
If you continue to run into these errors you’ll have to contact your mail provider for further assistance.
Cheers.
I have eliminated the app registration in O365, then created a new one and sucess.
SMTP continues to get an error : 535: 5.7.3 Authentication unsuccessful i will continue trying...
Thanks Kevin