OAuth not working

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

OAuth not working

Post by openrage »

Script URL:
Version of script: 3.4.0
Hosting company: Hosted on site
What terms did you try when SEARCHING for a solution: OAuth

Write your message below:
While setting up OAuth everything went fine however when I save my Oauth provider I was not sent to Microsoft sign in only got Success: OAuth provider has been saved
When I went into IMAP Fetching and set everything up it tests successfully however emails are not being pulled in.
I set up cronjob to run hesk_imap.php but nothing.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

What happens if you manually run hesk_imap.php in browser (step 5 in the article)?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

Re: OAuth not working

Post by openrage »

If I do that I receive the following

#!/usr/bin/php -q
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

Go to Admin > Settings > Help desk > under "Features" find "Debug mode", turn it off and save changes.

Then open the hesk_imap.php file again. What does it say now?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

Re: OAuth not working

Post by openrage »

I now get this however I have 3 unread messages in that inbox.

#!/usr/bin/php -q
Connected to the IMAP server "outlook.office365.com:993".
No unread messages found.
Disconnected from the IMAP server.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

Are the unread messages maybe in a shared mailbox or somewhere? Office will only send emails from the actual inbox to Hesk.

How about if you mark them read, then unread again?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

Re: OAuth not working

Post by openrage »

messages are in a standard office 365 mailbox located in the inbox. I marked as read then back to unread and receive the same message.

Like I mentioned when I setup the OAuth provider I was not directed to sign into microsoft with my account.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

What exact success message do you get if you go to Admin > Settings > Email and under IMAP Fetching click "Test connection"? How many messages are mentioned?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

Re: OAuth not working

Post by openrage »

Below is what I get

Success: Connection successful!

Number of emails your mail server will send to Hesk: 0
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

That means the connection works (you were probably logged in already when adding an OAuth provider), but nothing is sent over IMAP.

Not sure what to look for here. It wouldn't make sense that Office 365 would send a wrong status message over IMAP.

Are you sure the unread messages are in the INBOX, and not some other folder?
Can you send a screenshot of your Inbox folder (login at outlook.office365.com) to me in a private message?
Are you able to create a test email address in your O365 account and try connecting to that mailbox, to see if that makes any difference?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
openrage
Posts: 7
Joined: Wed Mar 11, 2020 10:13 pm

Re: OAuth not working

Post by openrage »

PM Sent, also tested a different email in IMAP settings. Still was not prompted to login on OAuth providers and gave same messages.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

For anyone else experiencing problems, try this:

1. delete the OAuth provider
2. open Hesk in a PRIVATE BROWSING window to make sure you are not logged in anywhere
3. add OAuth provider
4. when adding it and asked to login, make 100% sure you login with the email account you will use for Hesk
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
kerstens
Posts: 8
Joined: Wed Sep 13, 2017 2:54 pm

Re: OAuth not working

Post by kerstens »

Klemen wrote: Fri Sep 23, 2022 8:00 pm For anyone else experiencing problems, try this:

1. delete the OAuth provider
2. open Hesk in a PRIVATE BROWSING window to make sure you are not logged in anywhere
3. add OAuth provider
4. when adding it and asked to login, make 100% sure you login with the email account you will use for Hesk
I had the same issue, but this solved the problem. Thanks.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: OAuth not working

Post by Klemen »

Great, I've added a notice about this to the Knowledgebase article.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply