Table of Contents

Google Drive with Service Account

Yasuhiro Miyoshi Updated by Yasuhiro Miyoshi

Google Drive

This is the procedure for integration with Google Drive. By integrating with Google Drive, we will obtain information on files that are publicly available.

・Account information will not be obtained.
・We will retrieve the names and links of files that are public (shared) on the shared drive (including My Drive). Data will not be synchronized with MoneyForward Admina.
・To view files, you must have the Admin role in Admina.About Admina admin users: What is the difference between roles?

 

Preparation

Enable API(Google Cloud Platform)
  1. Create an account for integrating with Google Cloud Platform. Access Google Cloud Console and select your project.
  2. APIs & Service> Enabled APIs & Service、Make sure the following two APIs are enabled. If not, add them from the API Library.
  • Google Drive API
  • Admin SDK API
Create Service Account
  1. Select APIs & Service > Credentials > Create Credentials > Service account
  1. Enter any name for the Service Account Name and click "Done" (steps 2 and 3 are not required).
Create an API Key
  1. Click on APIs and Services > Credentials to see the service account you created.
  2. Go to [KEYS] tab and click ADD Key > Create New Key.
  1. Select JSON and click the "Create" button. The message "Private key saved to your computerr" will appear and the JSON file will be automatically downloaded; keep the Client ID and other parameters necessary to integrate with Admina.

Setting up domain-wide delegation(Google Admin Console)
  1. Login to Google Admin console and go to Security > Access and data control > API controls, and click [MANAGE DOMAIN WIDE DELEGATION]
  1. Click [Add new]
  2. Open the saved JSON file and enter the client_id value from the Json file in the Client ID field.
  1. Enter the follwoing OAuth Scope and click [AUTHORIZE]
    1. https://www.googleapis.com/auth/drive
    2. https://www.googleapis.com/auth/admin.directory.user.readonly
    3. https://www.googleapis.com/auth/admin.directory.group.readonly
    4. https://www.googleapis.com/auth/admin.directory.domain.readonly
You can set https://www.googleapis.com/auth/drive.readonly instead of https://www.googleapis.com/auth/drive if you wish. The only drawback is that you won’t be able to remove permissions. Everything else will work.

Integration

  1. On the Admina integration screen, search for Google Drive.
  2. Open the saved JSON file. Enter the following values and click "Integrate".
  3. Service Account Email:Enter the client_email in JSON file.
  4. Private key:Enter private_key in JSON file.
    From -----BEGIN PRIVATE KEY-----to-----END PRIVATE KEY-----
  5. EmailPlease enter the email address of the privileged administrator of Google Workspace.
Trusted Domain: Allows you to exclude specified domains from detection of externally published files. Specify if you do not want the domain to be detected as external, such as the domain of a group company. If there are multiple domains, separate them with , (comma) as shown below.
moneyfoward.co.jp, i.moneyfoward.com
  1. After successfully integrating with Google Drive, the Services > "Files" tab will appear, displaying information about the shared files. (Synchronization will take some time to complete, depending on the number of files.)

If it does not complete successfully, please edit the status tab on the integration screen and try integrating again.

If the problem persists, please contact us via chat.🙏

         

How did we do?

Google Cloud Platform

Google Play Console

Contact