You are not logged in.
Hi All,
I have an issue trying to use the Oauth plugin in my GLPI to collect email from my O365 mailbox.
I've already successfully done the same process to another GLPI server couple of years ago, but this time , on a new server, it seems something is wrong.
I did follow lots of guide, and here is what I 've done so far, and the error I got. (I did follow that guide for instance : https://forum.glpi-project.org/viewtopic.php?id=284562 )
- I'm using a debian linux server for GLPI (v 10.0.2), and add the plugin Oauth (v1.4.1) by the market place
- So the app is registered in my Azure Portal.
- I put the app Client ID and Tenant ID to my OAUTH glpi plugin.
- I've created a secret on my azure app, and added the value to my Oauth entry as well.
Ten when I click on "create an authorisation", I put the o365 credential of the mailbox I would like to collect, password. But then it send my back to glpi with this error :
" Unable to save authorization code"
The php log gives :
glpiphplog.WARNING: *** PHP User Warning (512): Error during authorization code fetching: Expired token in /var/www/html/glpi/marketplace/oauthimap/inc/authorization.class.php at line 425
I've tried to change the callback url to be https / http with localhost .... but I stil have the same result. I also create a new secret, and put the new value in the Oauth plugin , still the same.
I would really appreciate if you can point me to the right direction , to sort this out.
Thank you
Offline
Hi ,
I'm wondering if someone has any clue to fix that ?
Thank you.
Offline
did you pass the command on the plugin folder :
chown -R www-data:www-data oauthimap
chmod -R 755 oauthimap
Last edited by eric.le-corre (2022-09-26 21:04:27)
Offline
this is always the same crap, stupid answers do you think we haven't tried the permissions yet?
clearly this is a bug on this plugin not working with oAth on O365
Offline
Hey, did you find a solution of the bug ? I receive the same message <Unable to save authorization code> while creating an authorisation for oauth IMAP plugin.
this is always the same crap, stupid answers do you think we haven't tried the permissions yet?
clearly this is a bug on this plugin not working with oAth on O365
Offline
Came across the problem today. Here is my experience and what worked for me. YMMV (Your Mileage May Vary).
I use Office 365 Business.
- Converted Shared Account to MailBox User (Yes, I had to pay for this unfortunately)
- Removed and Recreated my App Registration (Done in Azure Portal / Active Directory)
- Removed and Recreated my API Permissions associated with my App Registration
After above I was able to add new OAUTH IMAP Provider and Oauth authorization successfully.
Hope this helps.
Offline
Anybody still having issues on this? I'm on 10.0.16 and yet get the same issue using marketplace plugin of OAuth.
Offline
Same. On 10.0.16. Also looking for fix. Tried removing/reinstalling plugin. Same issue.
Offline
Solved the issue. Check your logs. Try the following. Open a terminal windows and change to your "glpi" folder. For example:
$ tail -F public_html/glpi/files/_log/php-errors.log
1. Create new OAUTH Authorization. If it fails, check the logs for a clue. For example, I was getting the below:
---
[2024-10-13 03:40:23] glpiphplog.WARNING: *** PHP User Warning (512): Error during authorization code fetching: invalid_client
AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'XXX'. Trace ID: YYY Correlation ID: ZZZ Timestamp: 2024-10-13 03:40:23Z in /home/USER/glpi-10.0.16/marketplace/oauthimap/inc/authorization.class.php at line 425
Backtrace :
...place/oauthimap/inc/authorization.class.php:425 trigger_error()
...e/oauthimap/front/authorization.callback.php:77 PluginOauthimapAuthorization->createFromCode()
---
In my case I was using the wrong client secret. Once I updated the correct client_secret I was able to authorize successfully. Hope this helps anyone.
Offline
I have a similar issue and cannot create authorization.
[2024-11-14 08:19:16] glpiphplog.WARNING: *** PHP User Warning (512): Error during authorization code fetching: Expired token in /var/www/html/marketplace/oauthimap/inc/authorization.class.php at line 423
Backtrace :
...place/oauthimap/inc/authorization.class.php:423 trigger_error()
...e/oauthimap/front/authorization.callback.php:77 PluginOauthimapAuthorization->createFromCode()
public/index.php:82 require()
Offline