> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-actions-triggers-prototype.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MFA用プッシュ通知を構成する

> MFAにプッシュ通知を構成する方法について説明します。

[iOS](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk)と[Android](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk)用の[Guardian](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian)SDKにより、ベンダー固有のプッシュ通知サービス用にカスタムビルドしたアプリを使用することができます。AWSのSimple Notification Service（SNS）プラットフォーム用のプッシュ通知を構成するか、DTV（Direct to Vendor）サービスを使用して、Firebase Cloud Messaging（FCM）およびApple Push Notification（APN）の資格情報をAuth0に直接追加できます。

## AWS SNSの構成

プッシュ通知を構成する前に、以下の前提条件に従ってください。

1. AWS Managementコンソールを使用して[SNSプラットフォームアプリケーションを作成](https://console.aws.amazon.com/sns/v3/home?region=us-east-1#/mobile/push-notifications/platform-applications)し、そのARNをメモします。
2. プラットフォームアプリケーションエンドポイントを作成するために、認可されたAWSアクセスキーIDを作成します。Guardianは登録成功の一環として、適切なデバイストークンでプラットフォームアプリケーションエンドポイントを自動作成します。

### AWS SNSでプッシュ通知を構成する

Guardianからプッシュ通知を受け取るには、まずGuardianのデフォルトのSNS設定を上書きする必要があります。その後、AndroidとiOS用のプッシュ通知を構成することができます。

1. Auth0 Dashboardから、[［Security（セキュリティ）］>［Multi-factor Auth（多要素認証）］](https://manage.auth0.com/#/security/mfa)に移動し、**［Push via Auth0 Guardian（Auth0 Guardian経由でプッシュ）］** を選択します。メソッドが非アクティブの場合は、右上にあるトグルで有効にします。
2. **［Custom（カスタム）］** を選択し、追加設定を表示します。
3. ［Push Notification Service（プッシュ通知サービス）］セクションで **［Amazon SNS］** を選択します。

<Frame>
  <img src="https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=e95bf965e33631662d362cf3d13cf6f8" alt="［Auth0 Dashboard］ > ［Security（セキュリティ）］ > ［Multi-factor Auth（多要素認証）］ > ［Guardian］ > ［Custom（カスタム）］ > ［Amazon SNS］" data-og-width="2006" width="2006" data-og-height="1254" height="1254" data-path="docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=280&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=40870b7ac31194a47f206040263d5c1b 280w, https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=560&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=543f9f783aea68bc4bad499adcf5e184 560w, https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=840&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=89cbe721fada5080cad6fdbf0c165026 840w, https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=1100&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=f369f5b23cb7ff62719f94c257996f62 1100w, https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=1650&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=2f168a3ae7f1157ba4fb714472645920 1650w, https://mintcdn.com/docs-dev-actions-triggers-prototype/dadTd1GKGvbSPiSP/docs/images/ja-jp/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/43644347942a224b271008b358afde0c/2025-01-27_11-22-59.png?w=2500&fit=max&auto=format&n=dadTd1GKGvbSPiSP&q=85&s=9813694773041b9d8972ac657bba9f93 2500w" />
</Frame>

1. ［Amazon SNS Configuration（Amazon SNS構成）］セクションで、次のフィールドに入力します。

   | フィールド           | 説明                    |
   | --------------- | --------------------- |
   | AWSアクセスキーID     | 自身のAWSアクセスキーID。       |
   | AWSシークレットアクセスキー | 自身のAWSシークレットアクセスキー。   |
   | AWSリージョン        | 自身のAWSアプリケーションのリージョン。 |
2. **［Save（保存）］** を選択して変更を完了します。

## FCMを使用してAndroid用のプッシュ通知を構成する

<Tabs>
  <Tab title="FCMの資格情報の取得">
    Auth0 DashboardでAndroidのプッシュ通知を構成するには、まずFCMサーバーの資格情報を取得します。詳細については、Googleの「[Firebaseドキュメント](https://firebase.google.com/docs/admin/setup#initialize-sdk)」を参照してください。

    1. Firebaseコンソールに移動し、該当プロジェクトを選択します。
    2. **［Settings（設定）］** メニューを開き、**［Service Accounts（サービスアカウント）］** を選択してください。
    3. **［Generate New Private Key（新しい秘密鍵を生成）］** を選択すると、資格情報ファイルをダウンロードすることができます。

    資格情報を取得したあと、Auth0 Dashboardでプッシュ通知を構成することができます。
  </Tab>

  <Tab title="Auth0 Dashboardの構成">
    資格情報を取得したあと、Auth0 DashboardからAndroidのプッシュ通知を構成することができます。

    1. [［Security（セキュリティ）］ > ［Multi-factor Auth（多要素認証）］](https://manage.auth0.com/#/guardian)に移動し、**［Push Notification using Auth0 Guardian（Auth0 Guardianを使ったプッシュ通知）］** を選択します。
    2. ［Push Notification App（プッシュ通知アプリ）］セクションから、**［Custom（カスタム）］** を選択し、追加設定を取得します。
    3. ［Android App Configuration（Androidアプリ構成）］セクションで次の設定を行います。

       | 設定                 | 説明                                                                                                                                                                 |
       | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
       | Androidアプリの有効化     | Auth0がカスタムアプリケーションにプッシュ通知を送ることを許可します。このオプションを有効にしない場合、プッシュ通知は送信されません。                                                                                              |
       | Google PlayストアのURL | MFAの構成のためにユーザーがダウンロードする必要があるカスタムアプリケーションへのリンクを提供します。                                                                                                               |
       | FCMサーバーの資格情報       | \[FCMサーバーの資格情報]（[https://firebase.google.com/docs/admin/setup#initialize-sdk）をアップロードします。](https://firebase.google.com/docs/admin/setup#initialize-sdk）をアップロードします。) |
    4. **［Save（保存）］** を選択して、変更を完了します。
  </Tab>
</Tabs>

## APNを使用してiOS用のプッシュ通知を構成する

<Tabs>
  <Tab title="APN証明書の取得">
    Auth0 DashboardでiOSのプッシュ通知を構成するには、まずAPN証明書を取得します。

    1. Apple開発者アカウントから[新しいAPN証明書](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns#2947597)を生成します。

    2. 証明書を自分のデバイスにインストールします。

    3. キーチェーンアクセスで、**Apple Sandboxプッシュサービス：｛Appld｝** 証明書を見つけます。

    4. パスワードを入力せずP12ファイルへ証明書と関連秘密鍵をエクスポートします（デフォルト名：`Certificates.p12`）。

    5. RC2の代わりにTriple DESを使用してP12ファイルを生成するには、

       ```lines theme={null}
       openssl pkcs12 -in Certificates.p12 -legacy -nocerts -nodes -out pk.pem -passin pass:"" &&
       openssl pkcs12 -in Certificates.p12 -legacy -nokeys -out cert.crt -passin pass:"" &&
       openssl pkcs12 -export -inkey pk.pem -in cert.crt -descert -out Certificate_3des.p12 -passout pass:"" &&
       rm pk.pem cert.crt
       ```

    6. `Certificates.p12`を削除して、Auth0 DashboardのAPN証明書として`Certificate_3des.p12`を使用します。

    資格情報を取得したあと、Auth0 Dashboardでプッシュ通知を構成することができます。
  </Tab>

  <Tab title="Auth0 Dashboardの構成">
    資格情報を取得したあと、Auth0 DashboardからiOSのプッシュ通知を構成することができます。

    1. [［Security（セキュリティ）］ > ［Multi-factor Auth（多要素認証）］](https://manage.auth0.com/#/guardian)に移動し、**［Push Notification using Auth0 Guardian（Auth0 Guardianを使ったプッシュ通知）］** を選択します。
    2. ［Push Notification App（プッシュ通知アプリ）］セクションから、**［Custom（カスタム）］** を選択し、追加設定を取得します。
    3. ［iOS App Configuration（iOSアプリ構成）］セクションで次の設定を行います。

       | フィールド            | 説明                                                                                                                                                                           |
       | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
       | iOSアプリの有効化       | Auth0がカスタムアプリケーションにプッシュ通知を送ることを許可します。このオプションを有効にしない場合、プッシュ通知は送信されません。                                                                                                        |
       | Apple AppストアのURL | MFAの構成のためにユーザーがダウンロードする必要があるカスタムアプリケーションへのリンクを提供します。                                                                                                                         |
       | APNのバンドルID       | iOS Developer Console提供。                                                                                                                                                     |
       | APNの証明書          | [P12証明書](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns)をアップロードします。 |
       | iOSアプリ環境         | Appleの開発者アカウントで構成したものに基づいて設定します。                                                                                                                                             |
    4. **［Save（保存）］** を選択して、変更を完了します。
  </Tab>
</Tabs>

## もっと詳しく

* [Auth0 Guardian](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian)
* [Guardian for Android SDK](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk)
* [Guardian.swift iOS SDK](/docs/ja-jp/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk)
* [カスタム登録チケットを作成する](/docs/ja-jp/secure/multi-factor-authentication/multi-factor-authentication-developer-resources/create-custom-enrollment-tickets)
* [プッシュAuthenticatorの登録とチャレンジ](/docs/ja-jp/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa/enroll-and-challenge-push-authenticators)
