Context-Aware Access Rule broke AppsScript access

Hello, community!

I'm currently working on implementing location-based access controls in Google Workspace and facing an issue.

There is only one Access Level for now.

Here's the setup:

Access Level Configuration: 

'Allow access to apps or apply rule if a user'

'Doesn't meet 1 or more attributes:'
Conditions
User's location is not: China OR Iran, Iraq, North Korea, Syria

This Access level is assigned to the 'Drive and Docs' application with the following settings checked:

  • Block users from accessing Google desktop and mobile apps if access levels arenโ€™t met
  • Block other apps from accessing the selected apps via APIs, if access levels arenโ€™t met

Problem: Everything works fine for users, but I've encountered an issue with Google Apps Scripts. When the access rule is active, running

DriveApp.getFolderById(<id-here>);

returns an error: "Authorization is required to perform that action." As soon as I disable Context-Aware Access, Apps Scripts starts working again.

I'm puzzled because, to my knowledge, there aren't any Google servers in the blocked locations that could affect this.

Questions for the Community:

  • Has anyone else experienced this problem with Apps Scripts when using location-based access rules?
  • Any insights on why this specific Access Level impacts Google Apps Scripts, even though there shouldn't be any Google servers in the blocked countries?

Thanks in advance for any help or guidance you can provide!

1 1 240
1 REPLY 1

We are experiencing the same issue. We discovered the scripts come from Google IP addresses listed with a country code of ZZ for Unknown.

Top Solution Authors