
Using OAuth for a simple command line script to access Google's data - joeyespo
https://martinfowler.com/articles/command-line-google.html
======
rahulrav
The next time you need to do something like this, take a look at
[https://github.com/openid/AppAuth-JS](https://github.com/openid/AppAuth-JS).

Here is an example which uses Node, and obtains your access tokens.
([https://github.com/openid/AppAuth-
JS/blob/master/src/node_ap...](https://github.com/openid/AppAuth-
JS/blob/master/src/node_app/index.ts))

Once you have that - you can make any API requests by using the correct
Authorization headers.

~~~
IloveHN84
The author wanted to use Ruby. JS is out of context here

~~~
shaftway
I think he meant as existing code you can pattern off of, not for direct
inclusion.

The OAuth 2.0 Playground at
[https://developers.google.com/oauthplayground/](https://developers.google.com/oauthplayground/)
is another good resource for understanding refresh tokens and access tokens
and how to get / exchange them.

