How to revoke access to a file, previously granted by the Google File Picker?

53 views
Skip to first unread message

Faustino Rodriguez

unread,
Oct 16, 2019, 6:45:08 AM10/16/19
to Google Apps Script Community
I am using auth/drive.file scope and the File Picker to grant access to specific files the user would select with the picker

How can the user (or the developer) revoke that access?

I noticed that after removing access from the account security checkup,
- Then reauthorizing the script again
- The previously granted files stay accessible, without the need to use the picker again

Thanks for any hints on this
Fausto

Dimu Designs

unread,
Oct 16, 2019, 10:41:19 AM10/16/19
to Google Apps Script Community
ScriptApp.invalidateAuth()

You can use the above method from Apps Script.

Users can also revoke access from their Google Accounts.

Alan Wells

unread,
Oct 16, 2019, 12:53:23 PM10/16/19
to Google Apps Script Community
I'm no authority on this subject, but I think at some point I saw something about the Google File Picker being integrated with the browser cookies.  I have no idea how it works.  All I'm saying is, you could try clearing the browser cookies and see what that does.  And I'd be interested in knowing.

Faustino Rodriguez

unread,
Oct 16, 2019, 1:16:29 PM10/16/19
to Google Apps Script Community
Unfortunately, none of those approaches work in this case

After removing access, either from the user account security or by invalidateAuth function
- the script asks for authorisation again
- but still keep access to those files it granted access before with the picker
- the Picker authorization seems to go over the script authorization, it is from another realm ... ;)
- no idea where/if it can be revoked

@Eric, could you help on this?

I also try the cookies, just in case but no result either
- the issue with the cookies and the picker is that it won't show up the list, if the user is blocking third-party cookies
Reply all
Reply to author
Forward
0 new messages