> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Google

> Google OAuthを`ale`に追加するガイドです。

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_01.png" />
</Frame>

> GCP コンソールの Google Auth Platform ページで `GET STARTED` をクリックして開始します。

***

## Overview

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_02.png" />
</Frame>

> Overviewページで、以下の値を入力し、`CREATE` をクリックします。

* **App Information:** アプリ名とGoogle OAuth同意に関する問い合わせ先メールアドレス。

* **Audience:** External。

* **Contact Information:** Google Cloud プロジェクト内の変更通知を受信するメールアドレス。

* **Finish:** Googleのポリシーに同意するチェックボックスを選択。

## Branding

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_03.png" />
</Frame>

> Brandingページで、アプリのドメインに関する情報を以下のように入力します。

* **Application home page:** デプロイした `ale` のURL: `https://app.[ドメイン]`。

* **Application privacy policy link:** OAuthを使用するサービスのプライバシーポリシーURL。

* **Application terms of service link:** Google OAuthを使用するサービスの利用規約リンク。

* **Authorized domains:**
  * アプリのホームページ、プライバシーポリシー、利用規約のドメインを入力。
  * 異なるドメインを使用する場合は、`ADD DOMAIN` をクリックしてすべてのドメインを入力。

<Tip>
  ロゴを登録しなくてもGoogle OAuthを使用できますが、ロゴを登録する場合は認証プロセスが必要です。
</Tip>

## Audience

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_04.png" />
</Frame>

> Audienceページで、`PUBLISH APP` をクリックしてアプリを利用可能にします。

## Client

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_05.png" />
</Frame>

> Clientページで、`CREATE CLIENT` をクリックし、以下の設定でOAuthクライアントIDを作成します。

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_06.png" />
</Frame>

* **Application type:** Web application。

* **Authorized redirect URIs:** `https://app.[ドメイン]/api/oauth/google/callback`。

## Data Access

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_07.png" />
</Frame>

> Data Accessページで、上記のスクリーンショットの順序に従ってスコープを追加します。

<Note>
  追加するスコープは `.../auth/userinfo.profile` です。
</Note>

## Client ID、Secretの確認

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/03_08.png" />
</Frame>

> 左サイドバーのClientページで、作成したクライアント名をクリックし、**Client ID**と**Client Secret**を取得します。

***

## 運用システムへの登録

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/ja/02_09.png" />
</Frame>

> オペレーションシステムにアクセスし、**Settings > Authentication Methods > Google dropdown**をクリックし、前の手順で取得した値を各フィールドに入力して `Apply` をクリックします。

<Tip>
  **Enable Login**オプションを無効にすると、Googleログインが無効になります。
</Tip>

<Info>
  適用後、ユーザーダッシュボードページに以下のように **Sign in with Google** ボタンが表示されます。

  <Frame>
    <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/ja/02_10.png" />
  </Frame>
</Info>

## Googleアカウントでログイン

### Sign Up

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/authentication/images/en/01_13.png" />
</Frame>

> Googleログインを完了すると、ユーザーは承認待ち状態になり、管理者承認に関するメッセージが表示されます。管理者が承認すると、`ale`にログインできます。

<Info>
  ユーザーの承認（有効化）については、[User Managementページ](/ja/operations/user-management#%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E6%9C%89%E5%8A%B9%E5%8C%96)をご参照ください。
</Info>

### Sign In

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/ja/04_25.png" />
</Frame>

> 管理者承認後、Googleログインを試みると、**Complete Registration**ページが表示されます。適切なスペースと名前を入力し、`Complete`をクリックします。

<Info>
  ダッシュボードにアクセスすると、指定した名前のスペースが作成され、[オペレーションシステムで事前に定義されたデフォルトリソース](/ja/operations/settings#%E3%83%AA%E3%82%BD%E3%83%BC%E3%82%B9%E3%83%97%E3%83%AD%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E7%AE%A1%E7%90%86)が割り当てられます。
</Info>

<Tip>
  ユーザー登録と管理の詳細については、[User Managementページ](/ja/operations/user-management)をご参照ください。
</Tip>
