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 use direct link to google oauth page for generating access token #603

Open
jorgeelmundoso opened this issue Jul 17, 2020 · 2 comments

Comments

@jorgeelmundoso
Copy link

jorgeelmundoso commented Jul 17, 2020

There is a oauth schema for installed apps, nicely implemented in
https://github.com/gdrive-org/gdrive/blob/c3cbcceedd6beb1fcff30f06ea7be7c29558d181/handlers_drive.go#L393-L406

It's only a few lines of code, but it will allow to print a url:

Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

and scan the token from stdin without having to download the file, and without visiting a third party website like:

https://duplicacy.com/gcd_start

Same approach could be pushed to the web gui, just have an input text field to paste the token back in.

Of course you would need to come up with a place to store the token, could be pushed into the config.

This would improve usability and remove the need to trust https://duplicacy.com/gcd_start to not nick a token.

@sasjafor
Copy link

This sounds really good and it would remove the hassle with gcd-token files if the token is stored by duplicacy.
And for the Web edition it could be encrypted with the rest of the config.

@vmsh0
Copy link

vmsh0 commented Oct 3, 2022

I second this.

Some points that imho are relevant:

  • Trusting duplicacy's centralized token thing is an absurd idea and I think the project shouldn't even offer that possibility
  • Setting up a service account only works for Workspace accounts, and requires to be a Workspace administrator
  • A service account is like killing a fly with a cannonball, i.e. you did it, and now have a very large and powerful object flying around as a side effect

I'm happy to submit a PR about this and plan to do so, I hope I'll find the time to work on it in the coming days/weeks.

UPDATE: apologies, but after wasting ~5 hours trying and failing to build the project due to the use of the old Go build system and unversioned dependencies, I decided to abandon the endeavour. If anyone wishes to take time to help me with the build, I'm happy to resume work.

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