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

Allow supplying own Google application credentials to bypass the common request quota #48

Closed
ylexus opened this issue Jun 13, 2020 · 13 comments

Comments

@ylexus
Copy link
Owner

ylexus commented Jun 13, 2020

No description provided.

@wheleph
Copy link

wheleph commented Jun 15, 2020

@ylexus FYI I'm working on this in my own fork of the project. I think I'll be able to contribute something this or the next week.

@ylexus
Copy link
Owner Author

ylexus commented Jun 15, 2020

@wheleph excellent, thanks for the effort. I have not thought well about this yet. Maybe something on the login screen that allows to browse for the user-supplied credentials.json and then save this preference in VarStore and allow for resetting it back?

@wheleph
Copy link

wheleph commented Jun 16, 2020

@ylexus to be clear I haven't started the actual implementation yet. So far I have been researching the topic of Google OAuth. But being a Java developer on sabbatical I'm eager to contribute to the application that I'm using to manage my photo library. But you definitely will be able to implement the feature faster yourself. So if that's something that should be done ASAP (depending if the app is close enough to the quota limit) I don't want to slow the feature down.

As for the functionality itself I think it would be useful to keep the option to use the default client_secret_xxx.json because generation of a new file is quite involved and may discourage non-tech users from trying this awesome app.

So as you suggested we can have an option on the login screen either to use the default credentials or to pick custom ones from a file. Maybe we could have a guided tour there on how to generate that file via Google Developer Console.

Having a separate action to "reset the file" may be confusing. I assume that if the client file is changed then the user needs provide their Google credentials again anyway thus effectively doing full re-login. So maybe if users want to change their client secret file they can just logout (as they currently do) and login again providing the new file.

@wheleph
Copy link

wheleph commented Jun 16, 2020

Oh, also this might be a stupid question but how can I run the application via gradle? When I try to do it via ./gradlew run I get an obscure error:

~/pro/jiotty-photos-uploader (master *=)$ ./gradlew run
./gradlew: line 39: cd: "./: No such file or directory
> Task :run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Users/wheleph/.sdkman/candidates/java/14.0.1-open/bin/java'' finished with non-zero exit value 1

I have vanilla java on my machine:

~/pro/jiotty-photos-uploader (master *=)$ java -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

Shall I have some extensions? Maybe something for JavaFX?

@ylexus
Copy link
Owner Author

ylexus commented Jun 16, 2020

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':run'.

Process 'command '/Users/wheleph/.sdkman/candidates/java/14.0.1-open/bin/java'' finished with non-zero exit value 1

I've just committed a few improvements to build.gradle that should give you the right error. I think you are missing CLIENT_SECRET_PATH env variable (or -DCLIENT_SECRET_PATH command line parameter to gradlew). If you update to the latest, it should be saying more now. If not, check ~/.jiottyphotosuploader/log/main.log

@ylexus
Copy link
Owner Author

ylexus commented Jun 16, 2020

@ylexus to be clear I haven't started the actual implementation yet. So far I have been researching the topic of Google OAuth. But being a Java developer on sabbatical I'm eager to contribute to the application that I'm using to manage my photo library. But you definitely will be able to implement the feature faster yourself. So if that's something that should be done ASAP (depending if the app is close enough to the quota limit) I don't want to slow the feature down.

There's absolutely no rush here. I think this use case covers a tiny portion of the user base, mainly developers. As you correctly mentioned, getting your OAuth set up is not very trivial. We can certainly create a tutorial which can potentially open this to advanced non-developer users.

As for the functionality itself I think it would be useful to keep the option to use the default client_secret_xxx.json because generation of a new file is quite involved and may discourage non-tech users from trying this awesome app.

Absolutely, the default must be left to use my app's credentials. In fact, that option on the login screen should be clearly marked as "for geeks only" :)

So as you suggested we can have an option on the login screen either to use the default credentials or to pick custom ones from a file. Maybe we could have a guided tour there on how to generate that file via Google Developer Console.

Yes, all hands for the tutorial.

Having a separate action to "reset the file" may be confusing. I assume that if the client file is changed then the user needs provide their Google credentials again anyway thus effectively doing full re-login. So maybe if users want to change their client secret file they can just logout (as they currently do) and login again providing the new file.

Yes, I agree this is how it should be done. And once they are on back on the login screen, they can switch the "custom client secrets" option off from there.

@ylexus ylexus changed the title Allow to supply own Google application credentials to bypass the common request quota Allow supplying own Google application credentials to bypass the common request quota Dec 24, 2020
@ylexus
Copy link
Owner Author

ylexus commented May 6, 2021

I've started working on this.

@ylexus
Copy link
Owner Author

ylexus commented May 10, 2021

Released as 1.8.0 - still not able to release Windows 10 installators, all other OSes are fine.

@ylexus
Copy link
Owner Author

ylexus commented May 10, 2021

@marcovanree @sngnr @Cantolla would you please help with translations? TODO comments are placed as usual in Resource.xxx files.

@ylexus
Copy link
Owner Author

ylexus commented May 11, 2021

Dear @marcovanree @sngnr @Cantolla!

I have a small number of new phrases to to translate for Jiotty Photos Uploader after I added support for specifying custom Google API Client Secret. Could you please do it - the files are in their usual place - https://github.com/ylexus/jiotty-photos-uploader/tree/master/src/main/resources/i18n. You are all registered collaborators, so it’s easy to just translate online, even on the web, and create a pull request right from there.

Hope you’ll find time to help.

One note - it’s pretty impossible to translate “Google Client Secret”, so just leave it in English. This is what I’ve done in my Russian translation.

Thanks very much!

@ylexus
Copy link
Owner Author

ylexus commented May 11, 2021

Got my certificate, updated the 1.8.0 release with the Windows 10 package.

@Cantolla
Copy link
Collaborator

Hello @ylexus

If I edit from the browser using the link you provided I'm prompted with "Create a new branch for this commit and start a pull request" is this what you mean by "create a pull request right from there." ?

I will try to translate this week!

:)

@ylexus
Copy link
Owner Author

ylexus commented May 18, 2021

@Cantolla yes that’s exactly what I meant!

@ylexus ylexus closed this as completed Jul 15, 2021
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