Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google drive grants only 7 days access #887

Open
ccaneke opened this issue Sep 9, 2024 · 10 comments
Open

Google drive grants only 7 days access #887

ccaneke opened this issue Sep 9, 2024 · 10 comments

Comments

@ccaneke
Copy link

ccaneke commented Sep 9, 2024

I created a new client id and secret for a google drive desktop client application but I was only able to give access to external users (@gmail.com) because I created the client app using a gmail account and only users in a google workspace (@custom-domain) can be an internal user. I then had to give access to a test user because I didn't want the client app to be held in a long verification process if I publish it.

The problem is that as an external user I had my google drive access limited to 7 days. I want unlimited access that is only removed if google-drive-ocamlfuse unmounts google drive.

My system is fedora linux and I installed ocaml using the fedora package manager as described in: https://github.com/astrada/google-drive-ocamlfuse/wiki/Installation#installing-with-opam-on-nobara-linux.

@astrada
Copy link
Owner

astrada commented Sep 9, 2024

Yes, Google limits the refresh token for test applications to 7 days, but you can move it to production to remove that limitation (see #882).

@ccaneke
Copy link
Author

ccaneke commented Sep 9, 2024

Yes, Google limits the refresh token for test applications to 7 days, but you can move it to production to remove that limitation (see #882).

Thanks a lot. I changed the app to production. How do I force google-drive-ocaml-fuse to forget its state so that I can reauthorize and get a new access token. I've tried clearing the cache with google-drive-ocaml-fuse but that doesn't clear the state and so it still remembers the old client id and secret. I've also tried re-running google-drive-ocaml-fuse with the -id and -secret flags but the state is unchanged.

@ccaneke
Copy link
Author

ccaneke commented Sep 10, 2024

@astrada which step of the installation https://github.com/astrada/google-drive-ocamlfuse/wiki/Installation#installing-with-opam-on-nobara-linux creates the directory .gdfuse, is it 3 or 2?

@astrada
Copy link
Owner

astrada commented Sep 10, 2024

That directory is created the first time you run the application.

@ccaneke
Copy link
Author

ccaneke commented Sep 10, 2024

That directory is created the first time you run the application.

Thanks. Then to forget the credentials, I just have to delete .gdfuse and then run google-drive-ocamlfuse` with the -id and -secret flags.

@Medullitus
Copy link

Medullitus commented Sep 10, 2024

Thank you but isn't there easier way just like rclone provides?

@ccaneke ccaneke changed the title Google drive grants only 7 days access to google drive Google drive grants only 7 days access Sep 11, 2024
@ccaneke
Copy link
Author

ccaneke commented Sep 16, 2024

@astrada

$ google-drive-ocamlfuse ~/GoogleDrive
$ ls -a GoogleDrive/
ls: cannot access 'GoogleDrive/': Input/output error
$ sudo ls -a GoogleDrive/
ls: cannot access 'GoogleDrive/': Permission denied
$ cat .gdfuse/default/state | head -n 2
access_token_date=2024-09-09T03:24:47.000Z
auth_request_date=2024-09-09T03:24:47.000Z

Is this because the access token has expired? google-drive-ocamlfuse doesn't show any error or warning.

@astrada
Copy link
Owner

astrada commented Sep 16, 2024

Yes, I think so. Unfortunately the error reporting must go through the FUSE interface that is not suited to report friendly errors. If you want to be sure, you should enable debug logs and check the real error there.

@ccaneke
Copy link
Author

ccaneke commented Sep 19, 2024

@astrada
I deleted .gdfuse.

and then authorized google-drive-ocamlfuse to access the Google Drive account:

google-drive-ocamlfuse -id xxxxxxxxxx.apps.googleusercontent.com -secret XXX-YYY-ZZZ

which caused this warning:

GoogleDriveWarning

But after completing the OAuth authorisation process I still got the Input/Output error:

$ ls -a GoogleDrive
ls: cannot access 'GoogleDrive': Input/output error

so I ran:

fusermount -u ~/GoogleDrive
rm -rI GoogleDrive

then:

mkdir ~/GoogleDrive

, and finally

google-drive-ocamlfuse ~/GoogleDrive

succeeded.

I'm not sure whether removing the GoogleDrive directory or fusermount -u ~/GoogleDrive fixed the ls: cannot access 'GoogleDrive': Input/output error error.

I know that the Google hasn't verified this app warning can be avoided by submitting a verification request to Google like the warning says. Do you have any idea how long this verification request takes and what it requires? I don't plan on publishing this Desktop app so no one else but me will use it, however I'm curious about the verification process and what others think of it.

@astrada
Copy link
Owner

astrada commented Sep 22, 2024

It looks like you can push your app to production without Google verification: rclone/rclone#7963 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants