autoscan icon indicating copy to clipboard operation
autoscan copied to clipboard

Can't authenticate with Google DRive

Open viseniv opened this issue 1 year ago • 3 comments

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.

viseniv avatar Mar 12 '23 11:03 viseniv

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.

NiNiyas avatar Mar 22 '23 05:03 NiNiyas

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.

totermw_IONioPEAgZ 2

TeJayH avatar Dec 06 '23 10:12 TeJayH

Hey, this should now be fixed in the alpha branch. Could you please give that a try? If you are on docker, use ghcr.io/niniyas/autoscan:alpha_amd64 or ghcr.io/niniyas/autoscan:alpha_arm64, and don't forget to read the updated readme.

NiNiyas avatar Jul 11 '24 07:07 NiNiyas