Help with creating credentials

Hi, I’m trying to connect the Google Sheets OAuth2 API credentials on n8n Cloud.

I’ve followed all the steps and also tried clearing my browser cache and using an incognito window, but I’m still running into an issue.

After completing the OAuth flow, It doesn’t let me sign in to my google account. I see the message “Credentials saved”, but the credential status immediately changes to “Needs first setup” when I exit.

Could you help me understand why this is happening and how I can resolve it?

Hi @Aashna_Ramtri

To fix this, you need to force Google to treat this as a “first-time” authorization. Please follow these steps exactly:

  1. Revoke Google Access​:

    • Go to your Google Account Permissions page.
    • Find your n8n app/project in the list.
    • Click it and select Remove Access​. (This is the most critical step).
  2. Check your Google Cloud Console​:

    • Go to the Google Cloud Console.
    • Navigate to APIs & Services →→ OAuth consent screen​.
    • Ensure the Publishing status is set to “Testing”.
    • Under “Test users”, make sure the exact email address you are using to sign in is added to the list. If it’s not there, the flow will fail or behave inconsistently.
  3. Re-authenticate in n8n​:

    • Go back to your n8n Cloud credentials.
    • Click Sign in with Google again.
    • Complete the OAuth flow. You should now see the “Credentials saved” message, and because you revoked access in Step 1, Google will issue a new Refresh Token.
    • Exit the credential window and verify that the status now remains “Connected”.

If it still fails

  • Redirect URI​: Double-check that the OAuth Redirect URI provided by n8n Cloud is copied exactly into the “Authorized redirect URIs” section of your Google Cloud Console.
  • Scopes​: Ensure you have enabled the Google Sheets API in the “Enabled APIs & Services” tab of your Google Cloud project.

@Aashna_Ramtri Welcome

If it helps I do have a video step by step walkthrough of creating the Google OAuth

Are you on the Cloud hosted or self hosted @Aashna_Ramtri

Also under Audience > Test users is what trips a lot of people up. If the email address you’re using is not in the test users group you will not be able to authenticate.

Hey Michael,

Thank you for helping but it still doesn’t let me sign in. I followed the steps you mentioned but still the error is the same.

Hey kjooleng,

I tried to follow the steps you mentioned but the error is still the same :frowning: it just doesnt let me sign in.

@Aashna_Ramtri What do you see when you click “Sign in with Google”? Where’s the error?

Did you enable the proper Google Sheets API and it’s associated scopes?

Inside Google Cloud Console navigate to the API Library and enable the following APIs

Google Sheets
Google Docs
Google Drive

Once those are enabled, go to your project and go to Data Access > Add Remove Scopes and add the following scopes

Non-sensitive

Sensitive

Restricted




One other thing I’ll add, if you have all this enabled and you’re still not authorized and you’re not getting an error on the other side there may be an issue with the callback. Are you running n8n.io on the cloud or are you self hosting it? I was actually running into an issue with Cloudflare blocking the callback for Google.

@Michael_Frostbutter , OP is using

lol just waking up here in NY, it’s early :slight_smile: @kjooleng

Grab your cup of coffee :hot_beverage:

Just poured it :wink:

@Aashna_Ramtri Looking at the redirect URL you are using n8n Cloud, This means you don’t need to do anything on the Google side only click the Sign in with Google button, I would however recommend trying it from inside the workflow editor.

Pop open a new workflow, Add the Google Sheets node then add the credential and see if it works, It might be on the “needs setup” status because it has not yet been used by a node.

Hey Jon,
I tried this as well. Still the error comes the same it just says credentials saved but doesn’t let me sign in my google account. I have screen recorded it but here I can’t upload as it says new users cannot upload attachments. Can you please provide me with your email address so that I can send you?

@Aashna_Ramtri DM’d you

@Aashna_Ramtri I just review the video you emailed me.

Just like @Jon said, connect it from within a workflow.

Create a new blank workflow, add a manual trigger and a Google Drive download file node like the image below

Then click into the google node and click the edit pencil and try from within the node.


This should do the trick. Sometimes even though you’ve added the credential in the “credentials” tab you need to actually connect the account inside of a node on a workflow canvas

@Aashna_Ramtri one more thing, I did not see the auth window pop up in either of the videos you emailed me, check that there isn’t a popup blocker, blocking the auth pop up.

It worked. Thank you so much Michael!! This finally helped me to sign in and resolve the issue. You’re a star​:blush:

@Aashna_Ramtri Awesome!! Glad we got it working!

Working in IT my whole life has taught me one lesson I try to never forget, it’s usually a simple and obvious problem and a lot of people skip looking at the obvious.

If the oauth flow completes but the credential goes back to Needs first setup then i think it is like the authorization isnt being finalized correctly. so double check that the Google oauth client has the correct redirect uri configured and that you are signing in with the same Google account used to create the oauth app. If everything looks correct then check the n8n logs or browser console for any errors.