Nester

one of the dumbest things I’ve ever created.

Not because it’s dumb inherently, but worse. Google’s OAuth only allows a refresh token to last 7 days. In part 1 and Part one part 2 I walk through the mess that is Google’s OAuth system and Go library to support it.

7 days?

Ok, so there’s more to it. TL;DR is google expects you to write code that anticipates a granted refresh token to expire. The default is 7 days Link which is annoying as shit considering you have to manually go through the whole OAuth consent screen again to get a new one. IF ONLY THERE WAS A WAY TO AVOID THAT? WOULDN’T THAT BE SMART?

Leave it to Google to just leave it as a fuck you, write better code. Laziest shit I’ve seen in so long. Makes sense considering how trash all their cloud offerings are, why even try? This is just so awful. I get it, AWS - so customer obsessed. They’re just a different flavor of terrible brought typically by being obsessed with the wrong customer to inform designs.

So how can it work and how bad is it?

The way around it is by moving your OAuth application out of “Testing” which is what gates it to 7 day refresh. The docs only say this:

Refresh tokens can stop working after 7 days if the client ID is not approved is one possible cause. The 7-day token expiration is not related to Commercial or Sandbox approvals. A service or user account needs to get their OAuth 2.0 client ID approved and put into production to get longer token lifespans. See [Refresh token expiration](https://developers.google.com/identity/protocols/oauth2#expiration) for more information.

Cool. So unless I pay money for a commercial approval or move my OAuth app to basically be publicly available, I get 7 days.

WHY

I just don’t understand how all the cloud providers and services all became so trash. Like you get all this money from people wanting you to build things. You build a shit version that works for one big customer while calling everyone else it doesn’t work for dumb.

Sad face

I just wanted something to see how shit my nest was being compared to my bill. How this was so difficult is beyond me, maybe skill issues but damn, the cloud is really just piles of shit built on more piles of shit.

Here’s the code for the nester app if anyone cares about this nightmare. Worst case, it just furthers my avoidance of Google stuff - so not worth nothing I suppose.