1
votes

I've built an add-on for google spreadsheets using google apps script and I can't figure out why it asks for Drive permissions. The Drive API is not enabled, I'm not using DriveApp class anywhere in the project and the driveapp scope is also not defined anywhere, but it shows up in the OAuth Authorization Screen and makes the app to be unverified: enter image description here enter image description here

These are the scopes from the Project Properties: enter image description here

Scopes defined in the appscript.json file:

"oauthScopes": [
    "https://www.googleapis.com/auth/analytics.edit",
    "https://www.googleapis.com/auth/analytics.readonly",
    "https://www.googleapis.com/auth/script.container.ui",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/script.scriptapp",
    "https://www.googleapis.com/auth/script.send_mail",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/userinfo.email"
  ]

And finally, scopes authorized in the Google Cloud Platform, OAuth consent screen: enter image description here

2
Google SpreadSheets is part of Drive. This link shows the required OAuth scopes: developers.google.com/sheets/api/guides/authorizing - jwilleke
Did you had a look at this Stackoverflow? You might use the DriveApp in a comment. If that's not the case, try to remove scopes one by one and you'll see which one ask for Drive permissions. I would start with https://www.googleapis.com/auth/script.storage which might store scripts in the user's Google Drive, thus asking for Drive permissions - Frenchcooc
@jwilleke does it means that the driveapp scope is not required to be verified in the OAuth consent screen? - Valip
Can you provide your code to see where the call to Drive might come from? - ziganotschka
@ziganotschka the code is huge and it would be a pain to reduce it. I will try to remove the scopes one by one and see it I can figure out the problem this way. - Valip

2 Answers

0
votes

As written in the documentation of Google Sheets, you need few Drives authorizations to use the API if you do not work with public data.

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

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

https://www.googleapis.com/auth/drive (Request this scope only when it is strictly necessary.)

0
votes

It seems that I had the driveapp scope added in the G Suite Marketplace configuration and the OAuth screen don't ask anymore for the Drive permissions after removing that scope. The "Unverified" app message also don't show up anymore.