I have a workflow that reads/creates/updates folders and downloads files from unreal ZohoMail to put them in.
The workflow works fine, its just the OAuth2 credential needs refreshing every hour. I feel like i have tried all the steps i have read about, but have had no luck.
Can someone share how they have done it please, I feel like I am going crazy
This is a common problem with OAuth 2.0 authentication in Zoho Mail (and most Zoho services). Zoho’s OAuth 2.0 access token expires purposely in 1 hour (3600 seconds) for security reasons.
The key to solving this and avoiding requesting credentials every hour is to correctly implement the Refresh Token flow in your workflow. The Refresh Token does not expire (unless it is explicitly revoked or the token limit is exceeded) and is used to obtain a new Access Token when the old one expires, without the need for user intervention.
Check the following:
• Access_type=offline confirmation: Did you use this parameter in the first authorization code request to ensure that the Refresh Token was issued? If not, you will need to revoke the existing token (if applicable) and redo the initial authorization process.
• Storage: Are you correctly storing the value of the Refresh Token (which is long) and the Access Token (which changes every hour)?
• Refresh Call Parameters: Are your client_id, client_secret, refresh_token and grant_type=refresh_token all correct in the POST request for the /oauth/v2/token endpoint?
• Replacement: Are you using the Refresh Token to get the new Access Token and then replacing the old Access Token with the new one in your API calls?