Clears stored authorization so the user must approve access again.
class ScriptApp method .invalidateAuth()
ScriptApp is the Apps Script service.
.invalidateAuth() is the method name you will see after a dot in your code.
What it does
Why it's used
- Force re-consent after you add new scopes.
- Fix stuck auth during development or support.
Common errors
- Forgetting parentheses on invalidateAuth. Write ScriptApp.invalidateAuth(), not ScriptApp.invalidateAuth or invalidateAuth by itself.
- Skipping dots between chained calls. Each step needs a dot, like ScriptApp.invalidateAuth().
- Adding spaces where they do not belong. Write ScriptApp.invalidateAuth(), not ScriptApp .invalidateAuth(), ScriptApp.invalidateAuth (), or ScriptApp . invalidateAuth().
- Wrong capitalization. Use ScriptApp and invalidateAuth, not scriptapp or invalidateauth.
Explore
Related methods
-
.getAuthorizationInfo()
Returns what permissions the script has been granted.
-
.deleteTrigger()
Removes an existing trigger.
-
.getOAuthToken()
Returns an OAuth token for calling Google APIs as the user.
-
.getScriptId()
Returns the unique ID of the current script project.
-
.getService()
Returns a connected advanced Google service, like BigQuery or YouTube.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about ScriptApp.invalidateAuth().
How I Use Google clasp to Write Apps Script with AI
Google clasp keeps your Apps Script in files on your computer, so an AI like Claude Code can read, edit and push it. My setup, my push script, and what broke.
Read post →How I Send Invoice Emails Straight From a Google Sheet (With a Script You Can Copy)
A copy-ready Apps Script that emails invoices from a Google Sheet, flags bad rows, and nudges overdue clients once a week. A guest post by Tahir Abbas.
Read post →