Poonam Malve
Poonam Malve

Reputation: 147

Enable Google API OAuth Scope

For one of the application created using Google Apps Script, some scopes are automatically added as follows in my app:

https://www.googleapis.com/auth/drive

https://www.googleapis.com/auth/script.external_request

https://www.googleapis.com/auth/script.send_mail

https://www.googleapis.com/auth/spreadsheets

I've followed all the steps for OAuth Client Verification according to this documentation. But still, my verification process is pending and support team said that I need to add https://www.googleapis.com/auth/drive.file scope to my project.

Anybody know how to add/enable https://www.googleapis.com/auth/drive.file scope in the existing project.

Upvotes: 2

Views: 9803

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

When you authenticate your application you should request the additional scope

  1. Open the script project in the Apps Script editor.
  2. In the menu, select File > Project properties.
  3. Select the Scopes tab.
  4. Review the scopes your script currently requires and determine what changes need to be made. Click Cancel when finished.
  5. If the manifest file appsscript.json isn't visible in the left nav bar, select the View > Show manifest file menu item.
  6. Select the appsscript.json file in the left nav to open it.
  7. Locate the top-level field labeled oauthScopes. If it is not present, you can add it.
  8. The oauthScopes field specifies an array of strings.

example

{
  ...
  "oauthScopes": [
    " https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/userinfo.email"
  ],
}

check the documentation here

Upvotes: 7

Related Questions