4 ms·
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
by rahulrav 8y ago
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_app/index.ts https://github.com/openid/AppAuth-JS/blob/master/src/node_ap...)
Once you have that - you can make any API requests by using the correct Authorization headers.
- IloveHN84 8y agoThe author wanted to use Ruby. JS is out of context here
- shaftway 8y agoI 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.