I am trying to write a program that uses the Google Sheets API to read spreadsheets and operate on the data.
My program contains a credentials.json
file which I obtained from the Java Quickstart page (also obtainable from the Google Developers Console). I cannot use the Sheets API without it.
I want to distribute my program to a few consumers. However, I am not sure what the risk is of distributing a program which contains this credentials.json
file.
Anyone think he can enlighten me on the matter? Is there perhaps a safer alternative?
EDIT:
Looking the current answers, it seems that correct approach is OAuth 2.0. However, looking also at the Authorize Requests page and the Using OAuth 2.0 with the Google API Client Library for Java page, it seems that I still need to include some identification for my application before I can complete the authentication process. The only identification I know of is the API key and the client ID and client secret pair.
Just as a rule of thumb, I know I should not be distributing anything that has the word "secret" in it. That being said, I have seen other applications - such as Stackexchange - which you can authorize to access your account, and they are all able to identify themselves to Google Sign In. If these applications/sites can identify themselves to Google without presenting any security risks, then I am sure I can do the same.
Only one problem... How should I identify my application?