How to Setup Gmail OAuth authentication for use with Hesk
This guide works with Hesk version 3.4.0 and newer. To use OAuth, please upgrade to the latest version of Hesk.
Setting up OAuth authentication requires a bit of work and configuration; please be patient.
Unless you are a Google Workspaces user or plan to verify (Publish) your help desk application on Google, note that OAuth refresh tokens will expire every 7 days in Google. In this case, you may want to set up an App Password instead and use Basic authentication.
What you will need:
- a Hesk administrator account,
- a Google account,
- your Google mail (Gmail) account must have IMAP enabled to allow fetching emails,
- cURL support enabled in your PHP (check with your hosting company)
Part 1: prepare Hesk
- login into your Hesk admin panel with an administrator account
- go to Hesk > Admin > Tools > OAuth Providers
- click the New Provider button
- give the provider a descriptive name, for example, "Google"
- into the Authorization Endpoint URL field, enter:
https://accounts.google.com/o/oauth2/auth
- into the Token Endpoint URL field, enter:
https://oauth2.googleapis.com/token
- keep the form open and continue with the registration steps below in a new browser tab or window
Part 2: register Hesk
- Open the Google API Console.
- on the Enabled APIs & services page, click the CREATE PROJECT link