No refresh token (Google Cloud OAuth2)

Describe the problem/error/question

Hi I am having a similar issue as linked with the google cloud scope. So using a custom http request node…

I think my tokens last an hour then I have to sign in with the credentials again.

Looked around the forum but couldn’t get a definitive answer

-access_type=offline is set

-app is published

-body or head auth didnt make a difference

Thank you

reference:

What is the error message (if any)?

ERROR: No refresh token

Details

Time

2/16/2024, 2:10:21 AM

Item Index: 0

HTTP Code

rejected

Stack

NodeApiError: No refresh token
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1554:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:706:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExec

Share the output returned by the last node

No refresh token

Information on your n8n setup

  • n8n version:1.27.2
  • Running n8n via (Docker):

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @ohmikegot,

Can you share the settings you have used for the generic credential? If needed you can find we set here: n8n/packages/nodes-base/credentials/GoogleOAuth2Api.credentials.ts at master · n8n-io/n8n · GitHub

Thanks for a quick reply. I appreciate n8n and all the help. I think you gave me an idea. I basically made a generic oAuth2 for cloud because I read that cloud isn’t supported as a scope.

*I hid clientid

And it didnt refresh.

Yesterday I remade with Google OAuth2 credentialsfrom n8n and added cloud-platform as a scope anyway and it seems like it’s okay and working .

What did I do wrong with the generic one? Screenshot attached

The access token url we use is https://oauth2.googleapis.com/token and for the authURI we use access_type=offline&prompt=consent other than that assuming you are using body as the type it should be good.

1 Like

Remade with Google OAuth2 credentials from n8n (rather than custom) and added cloud-platform as a scope. Also @Jon provided a direct solution to my question. Thank you

1 Like

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