CreateGoogleProject - laurentalacoque/TouchSelfie-extended GitHub Wiki
Why should I need a Google Developers Project?
Access to sensitive informations of your Google account needs to be protected by a security mechanism named OAuth 2.0
For this, you need to:
- setup a project on the Google Developers Console,
- add access rights to the services you need (namely
Gmail Service
andGoogle Photos Library Service
) and - download a 'client secret' file that links TouchSelfie to your Google Project.
The remainder of this article will guide you through this.
Why don't you setup a global application that we could use?
Your Security and My Quota.
By retrieving yourself application credentials, you basically authorize yourself to access your own google account and you can revoke this whenever you want. Also, Application Credentials have a daily limit of free use, If I were to provide you my own credentials, a group of users would consume this quota in no time, leaving everybody with a bad experience.
Do I need to do this?
No.
All this is optionnal.
However if you want to be able to send emails in TouchSelfie OR you want TouchSelfie to automatically upload photos to your Google Photos Library then yes, you'll need to do this.
If this is the case, keep on reading, otherwise no need to bother ;)
Ok, let's create my project then :(
Create a new project
- Head to the Google Developers Console
- Create a project by clicking on the project selector (top line, right of Google APIs logo)
- A popup window lets you select or create a project. Choose 'New Project' at the top right of the window https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/1_create_project.png
- On the next screen, choose a project name and click the "Create" Button https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/2_create_project.png
- The project is created
Enable the Google APIs you need
The next step is to enable the APIs you need.
- If you need to upload photos taken by TouchSelfie to a Google Photo Album, you will need to enable
Google Photos API
- If you need to be able to send photos by mail from TouchSelfie you will need to enable the
Gmail API
- If you don't need any of these, why are you still reading this? Seriously...
Enable an API for your project
- On the Library Pane, select your project in the project selector (top row, right of the logo)
- In the API search field, search for the service name (either 'Gmail' or 'Photos' in our case)
- A card with the service will appear, click on it https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/3_select_api.png
- On the new page, verify that your project is selected (top) and click the "ENABLE" button https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/4_enable_api.png
- Voilà. The API you selected was enabled.
- If you need to enable a second API (e.g. you enabled 'Photos' and now want to enable 'Gmail', just do the process again starting from the Library Pane page.
Verify informations and download your project credentials
We're almost done here. The next step will be to verify that all the wanted API are activated for your project and download the credentials file that will link TouchSelfie with your Google Account
- Go to your Project DashBoard and verify that your project is selected (top row, right of the logo)
- Verify that the API you need are listed in the API list on the bottom of the page https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/5_verify_apis.png
All Good? Let's create credentials!
-
Click on the "Credentials" item on the left menu or click on this: App Credentials
-
Verify that your project is selected on top
-
Click the "Create Credentials" Button
-
Select 'OAuth client ID' item in the dropdown menu https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/6_create_credentials.png
-
In the new window, you must configure a 'consent screen', click on the 'configure consent screen' button
-
In the consent screen configuration window, fill anything you think usefull (you'll be the only one to see your consent screen anyways) and click the 'save' button at the bottom of the page https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/9_content_screen2.png
-
Back to the 'Create OAuth client ID' page, in the application type, select 'Other', fill in an application name and click on 'CREATE' https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/10_application_type.png
-
A popup window confirms that your client id was successfully created. Dismiss it by click on the 'OK' button https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/11_confirm_created.png
Phew! Our credentials are created, let's download them!
-
Go to the Credentials Page
-
you'll notice a line with the credentials name you just gave
-
click on the small 'download' icon at the right of your credentials https://github.com/laurentalacoque/TouchSelfie-extended/blob/master/screenshots/wiki/12_download_credentials.png
-
This downloads a small file in your system's download directory
Final step: install the credentials in TouchSelfie directory
- Locate your TouchSelfie installation directory
- copy and paste the file you just downloaded into the
TouchSelfie/scripts
directory - rename the file to
TouchSelfie/scripts/google_client_id.json
You're done!