> ## Documentation Index
> Fetch the complete documentation index at: https://support.i.moneyforward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Platform

> Google Cloud Platformとの連携手順です。Google Cloud Platformへの、管理者のログインから、連携方法まで一連の手順を解説します。

## サポートする機能

<Badge color="blue">アカウント削除</Badge> <Badge color="blue">アカウント作成</Badge>

## Google Cloud Platformとの連携概要

Google Cloud Platformとの連携はOAuthでの連携とAPIの連携の2種類ございます。以下の特長をご覧いただき、お客様の管理に合致する方法で連携を実施ください。

| 可能な操作 / 連携手順     | OAuth（New）      | API（Old）   |
| ---------------- | --------------- | ---------- |
| **インテグレーション単位**  | すべてのプロジェクトの一括連携 | プロジェクト毎の連携 |
| **連携可能な管理者**     | アカウント管理者        | プロジェクト管理者  |
| **サポート可能なアクション** | ユーザーの同期、削除      | ユーザの同期のみ   |

## OAuthでの連携（New：推奨）

### 事前準備

#### Google Cloud Platformへのログイン

[Google Cloud Platformログインページ](https://accounts.google.com/signin/v2/identifier?service=cloudconsole\&passive=1209600\&osid=1\&continue=https%3A%2F%2Fconsole.cloud.google.com%2F%3Fhl%3Dja%26pli%3D1\&followup=https%3A%2F%2Fconsole.cloud.google.com%2F%3Fhl%3Dja%26pli%3D1\&hl=ja\&flowName=GlifWebSignIn\&flowEntry=ServiceLogin)にて、管理者権限アカウントのメールアドレス・パスワードを入力し、ログインします。

#### Cloud Resource Manager APIの有効化

1. Google Cloud Platformにログイン後、プロジェクトを作成するか、**連携を実施したいプロジェクト**に移動します。

2. **APIs & Services** > **Enabled APIs & Services** に移動し、**Enable APIs and Services**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677584198042-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=1fff6ad75364a9fce27c7702f3e34f2f" alt="APIs & Services画面" width="3028" height="1314" data-path="images/integrations/n0b51m6id9/1677584198042-image.png" />

3. 検索欄から**Cloud Resource Manager API**を検索し、**Enable**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1677584311961-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=344b57e22578c9538bcc44a63438ec27" alt="Cloud Resource Manager API検索" width="2970" height="1082" data-path="images/integrations/n0b51m6id9/1677584311961-image.png" />

#### 連携用OAuthアプリケーションの作成

1. Google Cloud Platformにログイン後 、**APIとサービス > OAuth同意画面** に移動します。

2. Use Typeは`内部` を選択し、**作成**をクリックします。
   「Error 403: org\_internal」と表示され、連携に失敗する場合、Use Type`外部` で作成してください。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1729835644557-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=738f70f1c8043b0e69159283de953ee6" alt="OAuth同意画面" width="1059" height="597" data-path="images/integrations/n0b51m6id9/1729835644557-image.png" />

3. アプリ情報にアプリケーション名（例：当サービス）とユーザーサポートメール、デベロッパーの連絡先情報のメールアドレスを入力し、**保存して次へ**をクリックします。

4. スコープの追加と削除をクリックし、以下、いずれかのScope（URL）フィルタに追加し、表示されたScopeを追加します。画像はRead & Writeを許可する場合のScopeの設定例です。
   以下のスコープの追加後、**ダッシュボードに戻る**をクリックします。

   | 項目                                  | 値                                                          |
   | ----------------------------------- | ---------------------------------------------------------- |
   | **Read & Write**（ユーザーの同期、削除を許可する場合） | `https://www.googleapis.com/auth/cloud-platform`           |
   | **Read Only**（ユーザーの同期のみを許可する場合）     | `https://www.googleapis.com/auth/cloud-platform.read-only` |

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1729836159689-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=ea378e25d8ee260efca699bee3469ae3" alt="スコープ設定" width="1920" height="328" data-path="images/integrations/n0b51m6id9/1729836159689-image.png" />

5. 認証情報メニューをクリックし、＋認証情報を作成 > OAuth クライアントIDをクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1729836864879-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=7b4e6ad172a09a55c5a7b26e2682c10a" alt="認証情報作成" width="2062" height="1038" data-path="images/integrations/n0b51m6id9/1729836864879-image.png" />

6. 以下のとおりOAuthクライアントIDの作成を実施し、作成をクリックします。

   | 項目                 | 値                                                |
   | ------------------ | ------------------------------------------------ |
   | **アプリケーションの種類**    | `ウェブアプリケーション`                                    |
   | **名前**             | 任意の名前（当サービスなど）                                   |
   | **承認済みのリダイレクトURL** | `https://itmc.i.moneyforward.com/oauth/callback` |

   <img src="https://mintcdn.com/moneyforwardi/tafzl_sQ3HYSeWQI/images/integrations/n0b51m6id9/1729837579213-image.png?fit=max&auto=format&n=tafzl_sQ3HYSeWQI&q=85&s=a32072f5ab3ee10571508f67df2194f3" alt="OAuthクライアントID作成" width="1958" height="1656" data-path="images/integrations/n0b51m6id9/1729837579213-image.png" />

7. 表示されたクライアントIDとクライアントシークレットの値をコピーしておきます。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1729837670168-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=4c95f0e3837779d4d49cc141604dc9cf" alt="クライアントID確認" width="1184" height="1168" data-path="images/integrations/n0b51m6id9/1729837670168-image.png" />

### インテグレーションのセットアップ

1. インテグレーション画面にて、**Google Cloud Platform**で検索します。タブをOAuthを選択します。

2. クライアントIDとクライアントシークレットを入力し、連携するをクリックします。パーミッションは④で設定したスコープに準じた内容を選択します。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1729837759685-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=d35e5826b31b2294312c12a3efcad797" alt="OAuthインテグレーション設定" width="1046" height="1488" data-path="images/integrations/n0b51m6id9/1729837759685-image.png" />

3. 連携が成功すると、アカウント一覧に登録済みのユーザー情報が表示されます。正常に完了しない場合は、まず [SaaSとの連携に失敗する場合の対処法](/it-management/saas-management/93nahw45is-trouble) に記載のステップをお試しください。それでも解決しない場合は、[ご提供いただきたい情報](/it-management/saas-management/93nahw45is-trouble#info-to-provide) をご確認のうえ、[サポート窓口](/contact-support)までお問い合わせください。

## API Keyでの連携（Old）

### 事前準備

#### Google Cloud Platformへのログイン

[Google Cloud Platformログインページ](https://accounts.google.com/signin/v2/identifier?service=cloudconsole\&passive=1209600\&osid=1\&continue=https%3A%2F%2Fconsole.cloud.google.com%2F%3Fhl%3Dja%26pli%3D1\&followup=https%3A%2F%2Fconsole.cloud.google.com%2F%3Fhl%3Dja%26pli%3D1\&hl=ja\&flowName=GlifWebSignIn\&flowEntry=ServiceLogin)にて、管理者権限アカウントのメールアドレス・パスワードを入力し、ログインします。

#### Cloud Resource Manager APIの有効化

1. Google Cloud Platformにログイン後、**連携を実施したいプロジェクト**に移動します。

   <Info>
     連携はプロジェクト単位で実施します。取得したいユーザーのプロジェクトを選択し、連携操作を実施ください。複数回行うことで、複数のプロジェクトの連携が可能です。
   </Info>

2. **APIs & Services** > **Enabled APIs & Services** に移動し、**Enable APIs and Services**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677584198042-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=1fff6ad75364a9fce27c7702f3e34f2f" alt="APIs & Services画面" width="3028" height="1314" data-path="images/integrations/n0b51m6id9/1677584198042-image.png" />

3. 検索欄から**Cloud Resource Manager API**を検索し、**Enable**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1677584311961-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=344b57e22578c9538bcc44a63438ec27" alt="Cloud Resource Manager API検索" width="2970" height="1082" data-path="images/integrations/n0b51m6id9/1677584311961-image.png" />

#### 連携用サービスアカウントの作成

1. **APIs & Services > Credentials**に移動し、\[**CREATE CREDENTIALS**] をクリック、\[**Service account**]を選択します。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677585452479-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=261682a8c18ff092dbe9705a7cb1c703" alt="Credentials画面" width="3050" height="1458" data-path="images/integrations/n0b51m6id9/1677585452479-image.png" />

2. サービスアカウント名（Service Account Name）に任意の名前を入力し、\*\*\[CREATE AND CONTINUE]\*\*をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/nhCvfYeTrQC_KkoL/images/integrations/n0b51m6id9/1784061521911-google-cloud-platform.png?fit=max&auto=format&n=nhCvfYeTrQC_KkoL&q=85&s=e00b2cb0e558e6b5f5344bdaaf92e15e" alt="サービスアカウント作成" width="1324" height="1442" data-path="images/integrations/n0b51m6id9/1784061521911-google-cloud-platform.png" />

3. ロールを設定します。**Security Reviewer（セキュリティ審査担当者）** を選択後、 **Continue**をクリックします。最後に**Done**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677587749268-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=2327cd41ae67764cdf9d9d4127512e2f" alt="ロール設定" width="1560" height="1632" data-path="images/integrations/n0b51m6id9/1677587749268-image.png" />

#### 秘密鍵の作成

1. Service Accountから作成したサービスアカウント名をクリックし、\[**KEYS**]タブ > **ADD KEY** > **Create new key**をクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677588041192-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=7a5c6526ef763e3b7aac7bc94b0571cb" alt="KEYSタブ" width="2188" height="966" data-path="images/integrations/n0b51m6id9/1677588041192-image.png" />

2. Key typeはJSONを選択し、CREATEをクリックします。

   <img src="https://mintcdn.com/moneyforwardi/Qb7lZLvS8Hx0Rhjp/images/integrations/n0b51m6id9/1677588161134-image.png?fit=max&auto=format&n=Qb7lZLvS8Hx0Rhjp&q=85&s=1326acc646182d527525a2c5b5c0969d" alt="JSON Key作成" width="1048" height="642" data-path="images/integrations/n0b51m6id9/1677588161134-image.png" />

3. JSONファイルがダウンロードされますので保存しておきます。テキストエディタで開き、内容を確認ください。**JSONファイルの中に、連携に必要なパラメータがすべて記載されています。**

   以上で事前準備は完了です。

### インテグレーションのセットアップ

1. インテグレーション画面にて、**Google Cloud Platform**で検索します。タブをAPIに切り替えます。

   <img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1729836471408-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=934e2e2d93fa845c6184592c49137578" alt="APIタブ選択" width="488" height="725" data-path="images/integrations/n0b51m6id9/1729836471408-image.png" />

2. 前の手順でダウンロードしたJSONファイルの中に記述されている、以下の値をそれぞれ入力し、**連携する**をクリックします。

   | 項目                     | 値                    |
   | ---------------------- | -------------------- |
   | **ワークスペースキー**          | `project_id` を入力します  |
   | **サービスアカウントのEメールアドレス** | `client_email`を入力します |
   | **秘密鍵**                | `private_key`を入力します  |

   **-----BEGIN PRIVATE KEY-----** から **-----END PRIVATE KEY-----** までを入力ください。（先頭の `"` および最後の `\n",` は不要です。）

   <Info>
     エラーが表示される場合は、以下のヘルプをご参照ください。
     [「このアプリはGoogleで確認されていません」と表示される](/it-management/faq/dqpoevdgwg-google-error)
   </Info>

   <img src="https://mintcdn.com/moneyforwardi/tafzl_sQ3HYSeWQI/images/integrations/n0b51m6id9/1678093554971-image.png?fit=max&auto=format&n=tafzl_sQ3HYSeWQI&q=85&s=e0e75c4e8c368a2bf21761cd4e60e0c1" alt="API連携設定入力画面" width="1978" height="826" data-path="images/integrations/n0b51m6id9/1678093554971-image.png" />

3. 連携が成功すると、アカウント一覧に登録済みのユーザー情報が表示されます。正常に完了しない場合は、まず [SaaSとの連携に失敗する場合の対処法](/it-management/saas-management/93nahw45is-trouble) に記載のステップをお試しください。それでも解決しない場合は、[ご提供いただきたい情報](/it-management/saas-management/93nahw45is-trouble#info-to-provide) をご確認のうえ、[サポート窓口](/contact-support)までお問い合わせください。
