amdean / motion-notify

Notification system for Linux Motion providing upload to Google Drive and email notificaiton
GNU General Public License v3.0
32 stars 12 forks source link

gdata.ClientLogin deprecated, use Oauth 2 instead #4

Closed areidyOTH closed 9 years ago

areidyOTH commented 9 years ago

If your google account has 2-factor authentication enabled then login no longer works as gdata.ClientLogin was turned off recently by google (it was marked deprecated 3 years ago). The error message recommends using oauth 2 instead.

https://developers.google.com/identity/protocols/AuthForInstalledApps

Error message:

 File "/etc/motion-notify/motion-notify.py", line 92, in __init__
    self._create_gdata_client()
  File "/etc/motion-notify/motion-notify.py", line 125, in _create_gdata_client
    self.client.client_login(self.username, self.password, service=self.client.auth_service, source=self.client.source)
  File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 441, in client_login
    captcha_token=captcha_token, captcha_response=captcha_response)
  File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 373, in request_client_login_token
    response, ClientLoginFailed, response_body)
ClientLoginFailed: Server responded to ClientLogin request: 404, https://developers.google.com/accounts/docs/AuthForInstalledApps
amdean commented 9 years ago

This is fixed in the latest version. Code has been migrated to use OAuth and PyDrive. When upgrading remember to update the entries in the /etc/motion/motion.conf file as some additional parameters are now required. See the example in the create-motion-conf-entries.txt file.