If you found this post, you have most likely gone through the ‘normal’ authentication process before. Otherwise, check out this great post on how to authorise Google Apps Scripts by Kieran Dixon.
The “This app is blocked” error is a little different, as there is no more buttons that we can click on to continue authorising this app.
In this post, we’ll be going through a quick workaround so that you can get back to running your scripts. Note that this issue is still not entirely resolved, but you can follow any developments in Google’s issue tracker.
Configuring your project on Google Cloud Platform
Firstly, open up your ‘Project Settings’ in the Apps Script manager:
Then, under the ‘Google Cloud Platform (GCP) Project’ section, click ‘Change Project’. You should see the following screen:
Click the link in step 1. You will be redirected to your free ‘Google Cloud Platform (GCP)’. Here, click the ‘Select a project’ dropdown and create a new project.
Then, go to the ‘OAuth Consent Screen’ on the sidebar menu.
You now need to configure your project settings. For free Gmail accounts, select the ‘external’ user type:
Then, fill in any required fields. You can put the same email for both ‘User Support’ and ‘Developer’ email fields:
In the next page, click ‘add or remove scopes’ . You will then see a list of scopes available for your project. If you know which scopes you are using, select the relevant items. Otherwise, you can select all the scopes.
Scroll down in the sidebar and click ‘Update’. Then, scroll to the bottom of the ‘Scopes’ section and click ‘Save and Continue‘.
Next, add the users who should be granted access to your Google Apps Script.
After clicking ‘Save and Continue’, you can return to the main Google Cloud Platform page. Note that at this point, your project is still in ‘testing’. This means that you will be limited to the 100 user cap limit. However, as you don’t have to submit any verification applications to Google, you should be able to continue developing and testing your Google Apps Script.
Configuring your Google Apps Script project
After configuring the security settings, you should find your ‘Project Number’ in the Google Cloud Platform dashboard:
Copy the ‘Project Number’ into your Apps Script manager settings from above and click ‘Set project’. Your Apps Script project is now a ‘Standard’ GCP project under the ‘testing’ mode:
Running your Google Apps Script
You can now attempt to run your Apps Script. If the active user account has been added when we configured our users earlier, then you should see the following prompt:
Click ‘Continue’. You will then be able to authorise app permissions as before. If the active user hasn’t been added in the GCP project, you will see the following prompt:
To resolve this, ensure that the user Gmail account has been added to the OAuth consent screen for the project in Google Cloud Platform.
- This solution will likely work for personal Gmail accounts. If your company has an enteprise subscription Google Workspace, it is better for you to contact your Admin to help resolve this error.
- At the end of this solution, your project is still in ‘testing’. There are some limitations to this phase, which is why Google recommends you submit an application to verify your project if additional functionalities are required.
Hopefully you can get your Apps Script back up and running and continue developing as needed. Let me know in the comments if this has worked for you!