simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
167 stars 15 forks source link

Deprecation of Google Drive OAuth out-of-band authentication #121

Closed simont77 closed 1 year ago

simont77 commented 1 year ago

@NorthernMan54

I’m receiving a message from Google, saying that the authentication method that fakegato is using for Google drive storage will soon be deprecated. Could you have a look? thanks

https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html

https://developers.google.com/identity/protocols/oauth2/resources/oob-migration

NorthernMan54 commented 1 year ago

Do you know if the feature is being used or can we deprecate it?

simont77 commented 1 year ago

Sorry for the late answer. I personally use it, and I've asked Google for a grace period. I don't how many other does. Is it particularly difficult to update?

simont77 commented 1 year ago

@NorthernMan54 I experimented a bit.

I updated googleapis to version 109 in my test setup, and everything still worked with the old authentication tokens. Then I followed the new procedure in https://developers.google.com/drive/api/quickstart/nodejs to produce a new token, but now after launching homebridge I got this error UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined at homebridge_test/node_modules/fakegato-history/lib/googleDrive.js:243:25 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:14138) UnhandledPromiseRejectionWarning: Unhandled promise rejection.

Looking on the google API console, apparently the drive.files.list method goes through, but the drive.list.get method got an error.

Any thought?

simont77 commented 1 year ago

I find out that the procedure described at the link produced a token with a readonly scope. Changed it to full control and now it seems to work. So, it seems that no modification to fakegato is needed, but only recreation of the token. I will check further if everything is ok.

NorthernMan54 commented 1 year ago

@simont77 I have long since deprecated my other use case for Google drive ( I had been storing snapshots from my camera's there for a long time, but with the recent changes on the google side have stopped ). Personally have found the lack of stability of the Google offerings a bit troubling, but can't complain too much as its a free offering.

simont77 commented 1 year ago

Updated instruction with https://github.com/simont77/fakegato-history/commit/dbdc5c08fee3d71ac729cb745aa3f00dd6e7788e