Zoho WorkDrive Generic OAuth2 – Refresh Token not working

Hello,

I am attempting to connect to Zoho WorkDrive using the Generic OAuth2 API credentials in n8n (EU Instance). I am using the generic node because I need the specific scope WorkDrive.files.ALL.

The Issue:
The connection is successful initially, but it expires after 60 minutes. It appears the Refresh Token is either not being stored by n8n or not being issued by Zoho, despite having the correct parameters.

My Current Configuration:

Grant Type: Authorization Code

Auth URL: https://accounts.zoho.eu/oauth/v2/auth

Access Token URL: https://accounts.zoho.eu/oauth/v2/token

Auth URI Query Parameters: access_type=offline&prompt=consent

Authentication: Header

Scope: WorkDrive.files.ALL

Steps Taken:

Verified the Client ID/Secret are from api-console.zoho.eu.

Ensured the Client Type is set to “Server-based Application”.

Added prompt=consent to force the issuance of a new Refresh Token.

Tested the connection; it shows “Account Connected” but fails after the 1-hour access token expiry.

Is there a specific Token Parameter required for the Refresh phase that I am missing?

Hi @Chris360karat , welcome to the n8n communitty!

Zoho only returns a refresh_token on the first authorization. If you reconnect without revoking access, it won’t issue a new one.I’d recommend revoking the app in Zoho and authorizing again. Also double-check that access_type=offline is being sent correctly :+1:

1 Like

Your initial auth setup looks right. The problem is usually that n8n’s Generic OAuth2 credential doesn’t send the right parameters during the refresh phase.

In the credential settings, find “Token Parameters” and add explicitly: grant_type = refresh_token. Without this, some n8n versions don’t include it in the refresh request and Zoho silently rejects it.

Also verify: after the initial auth, go to Settings > Credentials > edit yours and check whether a refresh_token field is actually stored. If it’s not there, Zoho never issued one. In that case revoke access in Zoho’s API console, reconnect fresh, and confirm your app type is “Server-based Application”.

1 Like

Your settings look correct.

Could be a co-incidence, I had similar issues with Zoho OAuth 2.0 APIs yesterday, but it was resolved on it’s own without changing any settings on my end.

Hi @tamy.santos ,

thanks for the warm welcome and the suggestion!

I followed your advice: I revoked the app access within the Zoho API Console and re-authorized the connection in n8n to ensure a fresh refresh_token was issued. I also confirmed access_type=offline is included in the Auth URI parameters.

Unfortunately, the connection still expires after one hour.

Hi @pvdyck , thanks for the follow-up!

To give you more context, I am running a self-hosted instance of n8n (version 2.12.3).

I’m trying to apply your suggestions, but I’m having trouble locating those specific fields in this version’s UI:

Token Parameters: I don’t see a field explicitly labeled “Token Parameters.” In v2.12.3, do you mean I should add grant_type = refresh_token to the “Auth URI Query Parameters” or is there a hidden “Add Option” menu I should be looking for to find an “Access Token” parameter section?

Verifying the Refresh Token: When I edit my saved credentials, I can see my Client ID and Secret, but there isn’t a field that shows me if a refresh_token was actually saved after the “Account Connected” message appeared. Is there a specific place in the UI (or perhaps the database/logs) where I can confirm n8n actually received and stored it?

App Setup: I’ve double-checked and the app is definitely a “Server-based Application” in Zoho.

Since I’m on 2.12.3, if there’s a specific trick to getting the Generic OAuth2 node to handle the refresh phase correctly for Zoho, I’d love to know!

Thanks again for your patience and help.

Hi everyone,

I wanted to share that I found a workaround since I couldn’t get the Generic OAuth2 credential to store the refresh token correctly in v2.12.3.

Instead of using the built-in Credential system, I switched to a manual flow using the HTTP Request Node:

  1. App Creation: Created the app in api-console.zoho.eu as a “Server-based Application.”

  2. Authorization Code: Generated the initial code manually via the browser (using the required scopes).

  3. Refresh Token: Used Insomnia (or Postman) to exchange that code for a permanent refresh_token.

  4. n8n Implementation:

    • I store the refresh_token in an n8n variable node.

    • I use an HTTP Request Node at the start of my workflow to call https://accounts.zoho.eu/oauth/v2/token with grant_type=refresh_token.

    • This gives me a fresh access_token valid for 1 hour, which I then pass to my WorkDrive API calls.

It requires a few more nodes in the workflow, but it’s 100% stable and avoids the 60-minute expiry issue I was having with the generic credentials.

Thanks @tamy.santos and @pvdyck for the support!

2 Likes

Good solve. The manual token flow is honestly more reliable for Zoho anyway since you own the refresh logic. For anyone else on v2.12.3, the Token Parameters field is buried under Authentication and the label changes between versions. Chris’s HTTP Request approach is the safer bet.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.