Page 1 of 1

OAuth Providers

Posted: Thu Sep 22, 2022 5:50 pm
by bworrey
I am able to validate and it passes but when it gets back to the providers screen I have

Error: Access token missing in the JSON response.


Then when I go back into email
test the imap I get

Error: Unable to retrieve an access token. Please confirm your OAuth Provider settings and re-save them to acquire a new token.


We are using O365

Re: OAuth Providers

Posted: Thu Sep 22, 2022 5:56 pm
by Klemen
If you get an "Error: Access token missing in the JSON response" message then the provider was not verified properly, even if the OAuth Providers page says so (something for us to fix).

Does the verification work without errors, if you go to Tools > Oath Providers, edit the provider, select "Do not validate server certificates", and click save?

Re: OAuth Providers

Posted: Thu Sep 22, 2022 6:18 pm
by bworrey
It says verified but i get the error about JSON response

Image

Re: OAuth Providers

Posted: Thu Sep 22, 2022 6:19 pm
by bworrey
here is the photo

https://ibb.co/5LtWgf7

Re: OAuth Providers

Posted: Fri Sep 23, 2022 12:03 pm
by Klemen
Can you try this please:

1. go to Admin > Settings > Help desk and under "Features" turn "Debug mode" ON then save changes
2. download this file: https://hesk.com/extras/hesk3/hesk340_oauth_debug.zip
3. upload the oauth_functions.inc.php file to your "inc" folder (overwrite original file)
4. go to Admin > Tools > OAuth providers, edit your provider and click "Save"
5. copy/paste any errors or messages you get and send them to me (you can in a private message if it contains sensitive information)

Re: OAuth Providers

Posted: Fri Sep 23, 2022 1:01 pm
by bworrey
I get the same error

Error: Access token missing in the JSON response.

Re: OAuth Providers

Posted: Fri Sep 23, 2022 1:15 pm
by Klemen
There should be a textbox below the error message with some data when using the modified file? Did you copy it over the original one (make sure to unzip it first)?

Re: OAuth Providers

Posted: Fri Sep 23, 2022 1:34 pm
by bworrey
I made sure to unzip copied the file into the INC folder

This is the PHP
(removed by admin)


debug is on and this is the error I get


https://ibb.co/QYDywPs

Re: OAuth Providers

Posted: Fri Sep 23, 2022 1:52 pm
by Klemen

Re: OAuth Providers

Posted: Fri Sep 23, 2022 1:58 pm
by bworrey
no worries thank you

this is what it returned

Debug info:

R: false
J: NULL

Re: OAuth Providers

Posted: Fri Sep 23, 2022 2:45 pm
by Klemen
Ok, so it looks like a cURL connection error.

Please download the same file again (I made some changes to it) and try again, let's see if cURL reports any errors.

Re: OAuth Providers

Posted: Fri Sep 23, 2022 2:54 pm
by bworrey
this is the error i get now

STATUS: 0
Error: SSL certificate problem: unable to get local issuer certificate

Re: OAuth Providers

Posted: Fri Sep 23, 2022 2:56 pm
by bworrey
(REMOVED)

this is the address it populated

Re: OAuth Providers

Posted: Fri Sep 23, 2022 3:06 pm
by Klemen
That's a server-side SSL verification error. Here's the correct way to fix it:
https://stackoverflow.com/questions/246 ... ertificate

What you can also try as a workaround:
1. create a NEW Oauth provider (don't edit this one)
2. enter all the details
3. make 100% sure you select "Do not validate server certificates" before clicking "Save"
4. click Save and see if it worked?

Re: OAuth Providers

Posted: Fri Sep 23, 2022 3:46 pm
by bworrey
I have success
thank you
appreciate your time