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().
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to reference a different Google Spreadsheet in Apps Script?
Transferring Data Between Cells in Different Spreadsheets
Read post →Business Idea: Script Writing Tips and Tricks in Google Sheets
Discover unique techniques, collaborations, and automated aids tailored for aspiring writers. Improve your scriptwriting skills with powerful Google Sheets tools.
Read post →