Skip to content

Validate required scopes #103

Description

@HampusSwensson

Google seems to have done some changes with Apps Script when they included the service in Google Workspace Core Services this summer (https://workspaceupdates.googleblog.com/2026/06/google-apps-script-workspace-core-service.html)

The sync has stopped working due to this change and we now need to add oauthScopes to the appscript.json in the Apps Script project for it to work.

The scope handling can be automated from code by running the function below (https://developers.google.com/apps-script/concepts/scopes):

ScriptApp.requireScopes(ScriptApp.AuthMode.FULL, [
    'https://mail.google.com/',
    'https://www.googleapis.com/auth/spreadsheets'
]);

I don't have permission to push code to the repo. Either add me as a member in the github org, then I can push a branch and create a PR. Or let someone else do it.

function synkroniseraAnvandareOchGrupper() {
  kontrolleraGoogleFunktionKrav();
  synkroniseraAnvandare();
  synkroniseraGrupperAllaRader();
}

function kontrolleraGoogleFunktionKrav() {
  ScriptApp.requireScopes(ScriptApp.AuthMode.FULL, [
    'https://www.googleapis.com/auth/admin.directory.user',
    'https://www.googleapis.com/auth/admin.directory.group',
    'https://www.googleapis.com/auth/admin.directory.orgunit',
    'https://www.googleapis.com/auth/apps.groups.settings',
    'https://www.googleapis.com/auth/script.external_request',
    'https://www.googleapis.com/auth/spreadsheets'
  ]);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions