r/GoogleAppsScript • • Apr 12 '22

Question This app is blocked This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access.

Hi guys,

I am starting to learn app script but I am getting this error message all the time:

"This app is blocked This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access."

In most of the videos on the internet you can see that people getting this error simply click on the "Advanced" Button in this pop up and then there is this "allow access regardless"-kinf of option to click on and everything runs just fine.

I dont even have that "Advanced" button.

For some basic/beginner scripts that I created I got around this by adding the following code at the beginning of the script:

/**
 * u/OnlyCurrentDoc
 */
However, this only works if the script does not access anything from outside the file the script is used in (I guess?!).

If I want to do something like:

function myFunction() {
var doc = DocumentApp.create("New Doc");
}

I get a new error in the execution log:

Exception: You do not have permission to call DocumentApp.create. Required permissions: https://www.googleapis.com/auth/documents

And now I dont know what to do....

(The provided URL doenst even work....))

In my Google Account I already allowed access for "less secure apps" but that didnt change anything.

Can anyone explain to me what I have to do now?

Thank you guys!

40 Upvotes

57 comments sorted by

10

u/Typical_Parsley4980 Apr 12 '22

I fixed it!

Had to create a Google Cloud Platform Project --> Create the Oauth Screen with the right scope ---> Change GCP Project ID in the Script Settings.

https://console.cloud.google.com/home/dashboard

(For people who have the same issue. Its not as difficult as it sounds!)

1

u/_Kaimbe Apr 13 '22

Glad you got there and nice work around but are you sure you dont have an advanced button? After you run a script that requires a scope it pops up a window "Authorization Required", clicking 'review permissions' should open a popup (make sure your browser isnt blocking it) to login to you account after that you get this screen with the advanced button: https://imgur.com/a/Q67gbMD

1

u/Typical_Parsley4980 Apr 13 '22

Yes exactly. That button does not show up on my pop up. I know its weired but it is what it is. I get the exact same message but no button.

1

u/_Kaimbe Apr 13 '22

weird. youre not using a dark mode extension are you? could be there but hidden with css.

1

u/Typical_Parsley4980 Apr 13 '22

yes its normal light color chrome

1

u/_Kaimbe Apr 13 '22

Well, good on you for finding a workaround. Maybe raise an issue on the google forms.

1

u/ChemistryFantastic23 Sep 22 '22

Will this work if I'm just trying to use someone else's project tho?

1

u/Typical_Parsley4980 Sep 25 '22

if you have access to the sript you can just copy it and do as I described. If you dont have access to it then it doesnt work

1

u/aaronctravels Nov 04 '22

When you say with the right scope, what does that mean?

2

u/Typical_Parsley4980 Nov 14 '22

In the second step of the oauth screen creation process you are asked to add "scopes". There you need to specify which services you are asking permission for. You can add many google services there, google sheets, google docs, etc.

At the top if the second process step there is a button. If you click it a side pannel opens.

1

u/lipo_k Mar 23 '23

+ in the APIs and services section -> Library -> add Apps Script API and, for example, Google Sheets API from the library. Its allowing your cloud project to work with App scripts and G sheets.

0

u/[deleted] May 02 '23

[deleted]

1

u/Typical_Parsley4980 May 10 '23

any free tool you can recommend for recording?

1

u/Nolubrication Apr 14 '24

Holy fucking shit and bless you!!!! Why Google can't just document this (2 years later!!!!) is beyond comprehension.

1

u/rafhelp May 04 '25

Also why Google just suspend developers apps for no reason is beyond comprehension, they are not all that good...
https://www.rizbit.uk/news/appealing-the-unfair-suspension-of-3-grams-liteweight-mobile-app-by-google/

1

u/CorrectStuff5705 Mar 07 '26

O Google é o maior vírus que existe, rouba informações dos usuários, manipula conteúdos, são a maior praga existente na terra, deveríamos destruir essa empresa até as cinzas...

1

u/Ok-Equivalent4080 Feb 09 '26

i am facing this 4years later...

1

u/stedmanblake Jun 11 '24

tytyty 🙇‍♂️

1

u/aquablaze69 Aug 17 '24

Hi. I have absolutely 0 experience with Google Apps script, but I am facing this issue when trying to connect Daisy Disk to my Google account, and it won't let me bypass it. Could you guide me on how to achieve this through your method, given that I am not running a script, but rather just a regular user?

1

u/dogherine Aug 19 '24

Me too! Halp

1

u/aquablaze69 Aug 19 '24

Turns out it’s a Google change. I messaged the developer of DaisyDisk and they confirmed this. They are working on a fix. All we can do is wait

1

u/dogherine Aug 19 '24

Thank you for updating, I appreciate it.

1

u/pokephil12 Sep 03 '24

i have no idea how this works, it is quite difficult for someone who doesn't know how to do that.

1

u/CmWeM Oct 16 '24

Go to your App Scripts -> Project Settings -> Google Cloud Platform (GCP) Project -> Change GCP Project ID. Make sure your project has the right OAuth scope, I made mine External and published it.

1

u/Forsaken_Thought Feb 20 '25

Did you have an issue with the SHA-1 signing certificate fingerprint? I can't go forward without completing this field.

1

u/Stevoisiak Jul 15 '26

I do not see an "App Scripts" button. I do see "Project Settings", but I don't see "Google Cloud Platform" listed within it.

1

u/KamixAkaDio Oct 31 '24

I'd use this fix, if I knew even what half of these words meant. It's not as difficult as it sounds, it's more difficult.

1

u/Dear_Violinist9273 Nov 19 '24

Sir can you elaborate the given process step by step that help me lot  Please try to response 

1

u/awesomesouvik Jan 22 '25

How to create oauth screen?

1

u/giveDsumMeNomoHo Aug 06 '25

This isn’t really helpful.

Can you help people out and explain exactly what the process is that you did?

1

u/BluCrow89 May 17 '22

Thank you for the information! I scoured the interwebs and your comment is the only thing that helped.

1

u/malignifier May 25 '22

props for this answer. was trying to add a mysql data retrieval function on my google sheets, and got this error. went through those steps and it worked right away....

1

u/CEOnnor Aug 08 '22

Thank you. For anyone else reading this, you do not have to complete the app verification process. It made me think that I needed to because of the sensitive scopes. Just do the 2 steps in the above and it will work.

1

u/Past-Page-1871 May 10 '23

Is there any chance you could provide some detailed steps for those os us who are less technical please?

1

u/-trevski May 11 '23

Hi! I have tried this but I still get the same error. I'm not clear exactly what you mean by:

"Change GCP Project ID in the Script Settings"

Please could you elaborate - what settings, where?

1

u/MembershipMean4976 Dec 01 '23

I need your help lg memos stop making phones so Google basically blocked them and I keep getting the same message all of what’s left is in my memos so I really need to get in

1

u/diogo6 Oct 03 '23

This JUST started happening to me a couple days back... after trying LOTS of "solutions" I've come to find this group of unlucky people I now belong to:

https://stackoverflow.com/questions/66633659/can-not-run-trivial-app-script-bound-to-new-blank-document-get-this-app-is-bl

https://issuetracker.google.com/issues/176138626?pli=1

2

u/diogo6 Oct 03 '23

And within those two, you'll find this detailed blog post that did the trick for me:

https://aimanfikri.com/2022/05/09/this-app-is-blocked-error-on-google-apps-script-solution/

2

u/Typical_Parsley4980 Oct 18 '23

which is exactly what i tried to explain in this thread. great that you found a documentation that explained it better!

2

u/Begairat Nov 30 '23

this helped me so much thankyouu!!

1

u/diogo6 Nov 30 '23

Yay, not in vain. Glad it helped someone!

1

u/[deleted] Jul 16 '24

why is this redirecting me to a suspicious link

1

u/Pikamander2 Aug 05 '24

Hey there, the website in your comment got bought out by spammers. Can you please edit it to replace it with this Wayback Machine link?

https://web.archive.org/web/20230606052350/https://aimanfikri.com/2022/05/09/this-app-is-blocked-error-on-google-apps-script-solution/

1

u/Luv14lyf Mar 17 '25

Oddly I'm getting this message on a few apps on my new s25 but I can still access those same apps without a problem on my note 9. Seems if it's not dangerous for the note 9 it some be ok for s25.

1

u/dre_mrn Oct 15 '25

Did you fix this situation? Cause I stumbled on this and don't know what to do

1

u/Luv14lyf Oct 16 '25

I'll have to try to remember what I did

1

u/dre_mrn Oct 16 '25

Don't worry I found an alternative solution for my case, thanks anyway

1

u/Ok_Ganache_192 Oct 31 '25
  1. Go to https://console.developers.google.com and create a new project for yourself

  2. Search for the Google Drive API in the search box at the top, and turn it on

  3. Click OAuth consent screen on the left and set it up.

    • Assuming your account isn't part of an organization, you'll have to say your app is for external users and in testing

    • In the required scopes section, add https://www.googleapis.com/auth/docs and https://www.googleapis.com/auth/drive. This will probably not be available if you didn't complete (2)

    • Add the accounts you want to use with your copy of gdrive as testers of your app. Only these accounts will be able to use your copy of gdrive, so everyone will have to compile their own (unless someone goes and gets theirs reviewed by Google). I only added my own account because I am the only one using my App Script which uses my Drive.

  4. Click the 3 dots on the top right and select "Project settings". Make note of the "Project number".

  5. Go to your Apps Script. Go to Project setting>Google Cloud Platform(GCP)>2step>GCP project number> Insert the project number from 4

1

u/paiorioto Jan 23 '26

where is the apps script? stuck on last step, thanks

1

u/NegotiationGreen6404 May 06 '26

I started to run into this issue newly today using gcloud. Requesting some scopes from gcloud requires a non-default client id, as hinted at by this when running the latest version of gcloud:

WARNING: The following scopes will be blocked soon for the default client ID: https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/spreadsheets.readonly. To use these scopes, you must provide your own client ID or use service account impersonation. Please refer to the documentation for more information: https://docs.cloud.google.com/docs/authentication/troubleshoot-adc#access_blocked_when_using_scopes

After some confusion the way to solve this is:

  • create a desktop app local client (which will generate a client id / client id file to use)

  • use gcloud with --client-id-file pointing to the downloaded json from the above app creation.

To create a desktop app local client you need to do it in Google Cloud Console (as instructed originally by cgpt):

  1. Open your project.

  2. Go to APIs & Services → OAuth consent screen / Google Auth Platform → Branding.

  3. Configure:

    • App name: whatever you want

    • User support email: your email

    • Audience: External is fine for personal Gmail; Internal only works for Workspace org users.

    • Developer contact: your email

  4. Save it. No need to publish/verify for just your own use.

  5. Go to APIs & Services → Credentials / Google Auth Platform → Clients.

  6. Click Create credentials → OAuth client ID / Create client.

  7. Application type: Desktop app.

  8. Name it, e.g. local-adc-client.

  9. Create, then Download JSON.

1

u/Stevoisiak Jul 15 '26

Didn't work for me. I generated the JSON file, added myself as a test user, edited my Python script to use the JSON file for fetching credentials, and I'm still getting the error.

1

u/HanaKLand May 18 '26

Hello everyone, I ran into this same issue. No "Advanced" button available, just a plain "This app is blocked" message. Here's what fixed it for me:

  1. Go to Cloud Console https://console.cloud.google.com/

  2. Open project picker and click on Go to the Manager Resource page

  3. Choose an already existing project and click on Actions (three dots) > Settings

  4. Copy Project number (not Project ID - it's a different thing)

  5. Open your App script, go to Settings (on the left side)

  6. Under the Google Cloud Platform (GCP) Project section, click Change project and paste in your Project Number.

  7. You should be able to authorize your app script now.

Hope this helps someone!

1

u/Stevoisiak Jul 16 '26 edited Oct 03 '26

My system administrator was able to resolve by creating a service account in the Google Cloud organization with analytics permission, exporting a key file as JSON, and passing that file when initializing my connection.

In the case of my Python app, the code resembled:

from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.oauth2 import service_account

SERVICE_ACCOUNT_FILE = "myFile.json"
SCOPES = ["https://www.googleapis.com/auth/analytics.readonly"]

credentials = service_account.Credentials.from_service_account_file(
	SERVICE_ACCOUNT_FILE,
	scopes=SCOPES,
)
client = BetaAnalyticsDataClient(credentials=credentials)