Wednesday, October 21, 2015

Google API oauth flow with node.js

I think that video should speak for itself.

I had 25 minutes before I leave for BJJ (brazilian jiu-jitsu) and I was pretty sure I'll manage on time but I've made so many little mistakes in the process and I was a few minutes late. Shame on me - on the other hand I really liked the time constraint and rushing through London.

I should have known better... In reality I make these type of mistakes all the time. I think that it is a nature of work. Don't get me wrong but majority of the people I work with make these type of mistakes too - typos, discrepancies and the true strength is in overcoming challenges and working one step at a time - you probably noticed how many times I've reloaded the browser (all the time).

Enough talking. You have the video, you have the code:

( should explain some technical details)

That is just the beginning. You still need to store token somewhere and make actual API calls to use it... From the time perspective everything seems obvious. When starting the amount of components and dependencies can be overwhelming. I knew exactly what to do and even though it took me 37 minutes! (without the video it would be even longer as I would be focusing on other stuff)

Two major files that make it all possible (server and client):

(full source lives on GitHub and of course remember to keep your tokens, secrets and credentials safe)