# No refresh token (Google Cloud OAuth2)

**URL:** <https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326>\
**Category:** Questions\
**Created:** [February 15, 2024, 7:00pm UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326 "2024-02-15T19:00:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmikegot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ohmikegot/32/7327_2.png) [@ohmikegot](https://community.n8n.io/u/ohmikegot)\
**Post date:** [February 15, 2024, 7:00pm UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/1 "2024-02-15T19:00:54Z")

</div>

## 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:

> [@Refreshing OAuth2 token automatically](http://community.n8n.io/t/refreshing-oauth2-token-automatically/28355/3):
>
> Hi @Omnibas wave Welcome to the community! Would you be able to provide some steps on how to reproduce your problem? I’m curious if you’re running into something such as a query parameter being wrong such as not setting access\_type=offline in the oauth credentials, or something else that Google might need, or even this issue with the oauth token being a test user: But if you could tell us what all is needed to test this, I’d be happy to look into it slight_smile

## 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

```auto
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):**

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [February 15, 2024, 7:00pm UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/2 "2024-02-15T19:00:55Z")

</div>

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:**

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [February 16, 2024, 4:50am UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/3 "2024-02-16T04:50:45Z")

</div>

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](https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/credentials/GoogleOAuth2Api.credentials.ts)

---

<div class="post-metadata">

**Author:** ![ohmikegot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ohmikegot/32/7327_2.png) [@ohmikegot](https://community.n8n.io/u/ohmikegot)\
**Post date:** [February 17, 2024, 4:51am UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/4 "2024-02-17T04:51:37Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/e/3/e3d1556a6192263db05bc256de2b17d826da0d61.png)

\*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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [February 20, 2024, 5:12pm UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/5 "2024-02-20T17:12:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ohmikegot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ohmikegot/32/7327_2.png) [@ohmikegot](https://community.n8n.io/u/ohmikegot)\
**Post date:** [March 6, 2024, 10:47am UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/6 "2024-03-06T10:47:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [March 13, 2024, 10:47am UTC](https://community.n8n.io/t/no-refresh-token-google-cloud-oauth2/40326/7 "2024-03-13T10:47:15Z")

</div>

Closed on March 13, 2024, 10:47am UTC

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