KevinTheJedi I used the packed .phar plugin from the website, not github. I then extracted it per your instructions, edited the oauth.php and set the DB to use phar 0 and edited the folder path. I'm just a noob at coding, so I don't know what I did wrong.
MS OAuth2 Error: The API version 'V2' has been depreciated.
All you need to do is unpack the plugin, make the change to the file, run php lint test on the modified file (to make sure you don't have a typo, etc.) /path/to/php -l /path/to/file.php
, login to the database, go to the _plugin
table, find the oauth2 plugin record, update the install_path
(to remove the .phar
), and set isphar
to 0
. Then of course the plugin needs to be enabled.
Cheers.
jerer I have created the JSON file an placed it in the SCP directory of my OSTicket server but after I submit the ldP request I get a "Connection refused for URI https://myOSTicketURL/scp/mail.json"
Any thoughts/suggestions?
Hello, new here.
I have this problem but i can't find a solution for this. Any Ideas?
KevinTheJedi
Offline I extracted the contents of the phar,
php -r '$phar = new Phar("auth-oauth2.phar"); $phar->extractTo("./auth-oauth2");'
then changed the section in the oauth2. php, then recompiled the phar:
php -d phar.readonly=0 -r '$phar = new Phar("auth-oauth3.phar"); $phar->buildFromDirectory("./auth-oauth2");'
I then pasted the new phar over the existing .phar, I assume I don't need to make changes to the db as they have the same name.
I now have a green token, now but no mail is being scavenged. Any ideas why?
- Edited
KevinTheJedi When attempting this fix I am getting a 500 error after refreshing the webpage. Just want to make sure that im supposed to replace what was previously in that section of uaoth2.php with what you've provided?
Reverting the changes back in the _plugin table immediately lets me load the helpdesk. Gotta be something wrong with my oauth2.php im guessing.
osTicket Version v1.18 (724de45)
Web Server Software Apache/2.4.41 (Ubuntu)
MySQL Version 8.0.39
PHP Version 8.1.22
Edit: Fixed this by downloading a fresh phar and redoing the process! Now just getting AUTHENTICATE failed when saving. So going to read further up as I'm pretty sure this was mentioned before
Edit2: I'm just going to take a nap. I spelled the email wrong when I tried deleting and recreating. All is working now. Thanks as always!
- Edited
First of all, thank you @KevinTheJedi for being an absolute legend. Was able to get our system fixed thanks to your speedy resolution.
Second, just wanted to share that you can use Phar => zip converters and make the adjustments on a local client machine if need be. That's what I did and FTP'ed the updated files to the server.
need4swede Yikes, be careful of third party sites for unpacking. The one you listed doesn't even have a valid https certificate.
Gian2003k you didn’t read this thread apparently… https://forum.osticket.com/d/105728-ms-oauth2-error-the-api-version-v2-has-been-depreciated/41
- Edited
Leave it extracted and update the database. You don’t know if you repackaged it correctly and it could still have issues. Although if you were able to get a token it should be fine. Also you would need to make sure you logged in as the email itself (using incognito window). You also need to make sure fetching is enabled globally and that you have a valid running cron job/scheduled task. Lastly check your system logs for any related errors.
Cheers.
KevinTheJedi I already tried that solution, but it doesn't work for me.
KevinTheJedi
Cheers for getting back, I did notice the Green Token is just expiring, rather than renewing also the cron job is getting this syslog error
CRON[8181]: (osticket) CMD (php /var/www/html/osticket/api/cron.php)
CRON[8180]: (CRON) info (No MTA installed, discarding output)
That means you likely used wrong account when it brought you to MS to authenticate. Login and authorize as the email you are configuring in osTicket.
Cheers.
KevinTheJedi I literally do it now, and isn't working i still get the v2 has been deprecated
KevinTheJedi "set the install_path to plugins/auth-oauth2 (just remove the .phar)" maybe i did something wrong here... can you tell me all the commands please? and what i need to do? i'm not an expert of mysql
If you don't know how to run SQL queries then you should use a database GUI like HeidiSQL (windows) or SequelAce (mac). If you can't do that then you should simply wait for the new build of plugin to be released. Or follow the above instructions from @ElbowNi to repackage so you don't have to mess with db.
Cheers.
KevinTheJedi can't you simply telling me the query please?
Gian2003k you can use following commands to do that:
change for, if the plugin is a dir:
UPDATE ost_plugin
SET install_path
= 'plugins/auth-oauth2', isphar
= '0' WHERE install_path
LIKE 'plugins/auth-oauth2%';
change for, if the plugin is a phar file:
UPDATE ost_plugin
SET install_path
= 'plugins/auth-oauth2.phar', isphar
= '1' WHERE install_path
LIKE 'plugins/auth-oauth2%';
I hope, it helps you to do the task.