Skip to content

Instantly share code, notes, and snippets.

View tmclnk's full-sized avatar

Tom McLaughlin tmclnk

View GitHub Profile
@tmclnk
tmclnk / login.html
Last active August 29, 2015 14:02 — forked from entaq/Google_oAuth.js
OAuth2 end-to-end example for client auth using newStateToken
FAQ
Why open a new window for the authorization?
Because if you load the contents of the auth page directly IN a sidebar (or script) using HtmlService, its buttons won't work because they've been cajoled.
Why not just the the access token provided by GAS Libraries?
Because lord only knows what that thing is scoped for.
How do I clear my token?
Pass ?reset parameter to the url, or call clearMyAuthToken() directly.