> ## 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との連携手順です。マネーフォワードAdminaから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/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1677584198042-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=363d7cd0a02a6599250de4b745c9b908" 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アプリケーションの作成

4. Google Cloud Platformにログイン後 、**APIとサービス > OAuth同意画面** に移動します。
5. 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" />

6. アプリ情報にアプリケーション名（例：Admina）とユーザーサポートメール、デベロッパーの連絡先情報のメールアドレスを入力し、**保存して次へ**をクリックします。
7. スコープの追加と削除をクリックし、以下、いずれかの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" />

スコープの追加後、**ダッシュボードに戻る**をクリックします。

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

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

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

* アプリケーションの種類：`ウェブアプリケーション`
* 名前：任意の名前（Adminaなど）
* 承認済みのリダイレクトURI：`https://itmc.i.moneyforward.com/oauth/callback`

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

10. 表示されたクライアント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" />

連携に成功すると、アカウント一覧に登録済みのユーザー情報が表示されます。

正常に完了しない場合は、インテグレーション画面のステータスタブから編集し、再度連携をお試しください。

解決しない場合はチャットにてお問い合わせください。

Google Cloud Platformの連携概要については[連携ページ](http://admina.moneyforward.com/jp/integrations/google-cloud-platform)をご覧ください。

## 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/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1677584198042-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=363d7cd0a02a6599250de4b745c9b908" 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" />

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

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

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

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

<img src="https://mintcdn.com/moneyforwardi/A-P6iOfz3E8AuK8B/images/integrations/n0b51m6id9/1677586647991-image.png?fit=max&auto=format&n=A-P6iOfz3E8AuK8B&q=85&s=093d6587a281d7389662475e91790d50" alt="サービスアカウント作成" width="1640" height="1644" data-path="images/integrations/n0b51m6id9/1677586647991-image.png" />

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

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

#### 秘密鍵の作成

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

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

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

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

9. 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ファイルの中に記述されている、以下の値をそれぞれ入力し、**連携する**をクリックします。

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

* **ワークスペースキー：** `project_id` を入力します
* **サービスアカウントのEメールアドレス：** `client_email`を入力します。
* **秘密鍵：** `private_key`を入力します。
  **-----BEGIN PRIVATE KEY-----** から **-----END PRIVATE KEY-----** までを入力ください。（先頭の `"` および最後の `\n",` は不要です。）

<Info>
  エラーが表示される場合は、以下のヘルプをご参照ください。
</Info>

[「このアプリはGoogleで確認されていません」と表示される](/it-management/faq/dqpoevdgwg-google-error)
「このアプリはGoogleで確認されません」エラーが表示される

連携に成功すると、アカウント一覧に登録済みのユーザー情報が表示されます。

正常に完了しない場合は、インテグレーション画面のステータスタブから編集し、再度連携をお試しください。

解決しない場合はチャットにてお問い合わせください。

Google Cloud Platformの連携概要については[連携ページ](http://admina.moneyforward.com/jp/integrations/google-cloud-platform)をご覧ください。
