autoscan
autoscan copied to clipboard
Can't authenticate with Google DRive
Whe i try to autherntiicate with Google Drive it gives me this error: "Error 400: invalid_request" I want to monitor a Team Drive, and send rclone to update the cache.
Hi. Sorry for taking so long to reply. I think this is probably because Autoscan still uses the OOB method to authenticate, which was deprecated. Unfortunately, I don't have time to investigate this, but PRs are always welcome.
A quick fix is to replace this line in the /google/drive.py file
Change it from
redirect_url = "urn:ietf:wg:oauth:2.0:oob"
to
redirect_url = "https://127.0.0.1"
With this change when you auth successfully you'll get redirected to an empty localhost URL and you can just copy your auth code from the &code= section, so in this example, code would be ABC123 pasted into scan.py.
https://127.0.0.1/?state=NONSENSEHERE&code=ABC123&scope=https://www.googleapis.com/auth/drive
Not making it a proper PR because this is a pretty terrible way to do it, I just don't know the proper way, we can wait for someone who actually knows the modern gdrive api to do a proper fix but until then I can confirm this change makes the script functional for google drive again.