0

I found this code that syncs Fitbit data to a Google spreadsheet. I would like to adapt it a bit, but i am stuck trying to figure out how the authorization is saved. I think my confusion is a result of a lack of understanding how OAuth works.

Here is the code: https://github.com/qslabs/FitbitDailyData/blob/master/FitbitDailyData.gs

It lets you configure the keys, and then when you authorize the first time in a spreadsheet, it pops up an authorization window. The next time it doesn't need the authorization window. I understand it won't ask for authorization if it's already authorized, but how does it remember which account authorized it? I don't see it saving any access tokens anywhere. Is it just automatic somehow when using Google script OAuth library?

Thank you

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
shim
  • 9,289
  • 12
  • 69
  • 108

1 Answers1

0

Found out that the "oAuthServiceName" is the key to differentiating different accounts. The authentication is stored by Google, but if you change that value, then it will require a new authorization.

shim
  • 9,289
  • 12
  • 69
  • 108