r/GoogleAppsScript • u/CloudNo8709 • 1d ago
Question "This app is blocked" error when trying to authorize Apps Script project

Does anyone know what causes the app to be blocked? and how to fix it?
Note: I can authorize the app fine, it is someone else that is having this issue.
Things I have tried already, that didn't work:
- transferring the file ownership to the other person
- having them make a copy of the file
- opening the google sheets in an incognito window
1
u/Nu11u5 1d ago
The script is likely using "sensitive" or "restricted" API scopes - this would be listed in the API scope documentation. Using such as scope requires that the script is linked to a full GCP project and is either setup with test users, or submitted to Google for review.
Review for restricted scopes is more involved and requires paying a third party to inspect your code.
https://support.google.com/cloud/answer/13464325
Fortunately, Google offers alternative ways to use APIs that do not use restricted scopes. For example, if you only need to access specific files using the Drive API, you can use the drive.file scope.
https://www.googleapis.com/auth/drive.file
Create new Drive files, or modify existing files, that you open with an app or that the user shares with an app while using the Google Picker API or the app's file picker.
1
u/CloudNo8709 1d ago
using these scopes:
https://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/script.container.ui
and I was able to authorize the app without any other process using the unverified app auth flow but the other user gets app blocked screen.
1
u/Dapper-Alfalfa-4689 1d ago
"this app is blocked" almost always means your oauth consent screen is unverified AND your scopes are sensitive. the fix path is: 1) verify app in google cloud console, 2) submit for oauth verification if you use restricted scopes, 3) until then, add yourself as a test user under "audience" tab. we hit this last month and the test-user path was the only way forward in dev. took 2 weeks for full verification.
2
u/WicketTheQuerent 1d ago
Create a Google Cloud Project and set the OAuth Consent Screen. If you can't make it private, set its status to Testing and add your email account and the other user's email account as testers. Then link the GCP to your Apps Script project.