EzyOauth2 has now been superseded by Goa, so this document is for legacy information. For more information see OAuth2 for Apps Script in a few lines of code. If you are using EzyOauth2, it's easy to migrate. If you are starting up, consider using Goa instead - it's easier and has more features. Every time I think about what my next project will be, I almost always use whether or not I need to use Oauth2 as the deciding factor, because I know I'll spend more time wrestling with it than actually doing the interesting parts. One of the trickiest projects on this site is Google Oauth2 VBA authentication, and that was quite fun, and the implementation is such that the gory details of how it was implemented is hidden, by design. This means though, that every time I do reach for oAuth2 I have to learn it all over again. Similarly if you are using the Google Apps Script advanced services, all that is taken care of for you, and for javaScript apps, you can often use the gapi. JavaScript library. The common theme then is to protect people from Oauth2 because apparently it gives you a headache. I hate these things about OAuth2
Laying out some examplesIn this article I'll try to lay out some OAuth2 scenarios, and avoid shying away from the nasty bits. Hopefully the excercise will also help me having to relearn from scratch every time I need to implement something with Oauth2, and with any luck, you'll find it useful too. What is Oauth2?It's an authentication dance, designed to ensure that whoever is asking for access to a resource is a) allowed to b) likely to be who he says he is, accessing from an expected place It goes like this.
Google describes the process like this As a process it's fairly straightforward. However, implementation can be challenging.
For help and more information join our community, follow the blog, follow me on twitter, or follow me on g+ You want to learn Google Apps Script?Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, All formats are available from O'Reilly, Amazon and all good bookshops. You can also read a preview on O'Reilly If you prefer Video style learning I also have two courses available. also published by O'Reilly. |
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > OAuth2 for Apps Script in a few lines of code > Migrating from cEzyOauth2 >
Trying to like OAuth2
Subpages (13):
EzyOauth2 patterns
EzyOauth2 - taking some pain out of Apps Script API authentication
JSON web tokens
Multiple oAuth2 authentication packages
Oauth2 authentication for Asana
Oauth2 authentication for Microsoft OneDrive
Oauth2 authentication for podio
Oauth2 authentication for reddit
oAuth2 authentication for shoeboxd
Oauth2 step by step - apps script authentication for the Drive JSON API
Step by Step - Apps Script Oauth2 authentication with Github
Using Drive SDK from Google Apps Script
Using the gplus api in Apps Script
Comments