Google Drive - Configuration
Configuration: Authentication data for Digdash (service account + P12 file)
- Context
- Prerequisites
- Creating a new project
- Activating Google Drive API
- Creating a service account and a P12 file
- Precisions
Context
This document explains how to get authentication information that Digdash needs to connect to a Google Drive account.
We need the following information:
- Service account
- P12 file
Prerequisites
- Être client de G Suite ou Cloud Identity
- Être détenteur d’une ressource Organisation activé sur votre domaine.
Creating a new project
Go to your Google Cloud console at:
https://console.cloud.google.com/projectselector/home/dashboard?supportedpurview=project
You can either select an existing project or create a new project.
We are going to focus on the creation.
Then click on Create.
The next screen allows you to define the project. Give it a name and choose its associated Organization.Then click on Create.
Please wait for a few seconds, the creation takes a few seconds.
|
Activating Google Drive API
Go to your Google Cloud console at:
https://console.cloud.google.com/projectselector/home/dashboard?supportedpurview=project
Select the new project we just created.
In the left side bar, go to API & services > Library
Get down on the page to find G Suite > Google Drive API. Click on it.
In the next screen, click on Enable.
Creating a service account and a P12 file
In the left side bar, go to API & services > Credentials
In the next screen, click on Create credentials > Service account key
In the next screen, select New service account in the dropdown list Service account and enter a name in Service account name. This generates a Service account ID in an email address form (ending with gserviceaccount.com).
In the Role list, select Project > Owner
In the options Key type, select P12 then click on Create.
The P12 file will be downloaded automatically on your disk, please save it preciously. Click on Close.
In the next page, click on Manage service accounts (on the right).
Then, get the Service account ID (in an email address form).
Precisions
Even if you created the service account while connected to your own Google account, this service account is not related - in any way - to your own Google Drive account.
The service account is a Google account in its own right and has its own Google Drive account, its own Google Calendar, etc.
When uploading to the service account, the document will go to the service account’s Google Drive and not to the Google Drive of the Google account that was used to create the service account.
NB : There is no Web interface for a service account, which means that you can’t authenticate and list which documents have been uploaded. This can only be achieved via a client able to use this service account, like Digdash.