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

# Configure Push Notifications for MFA

> Configure push notifications as an Auth0 MFA factor with AWS SNS, Firebase Cloud Messaging, or Apple Push Notifications via the Auth0 Guardian SDK.

The [Guardian](/docs/docs/secure/multi-factor-authentication/auth0-guardian) SDKs for [iOS](/docs/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk) and [Android](/docs/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk) allow you to use a custom-built app for vendor-specific push notification services. You can configure push notifications for the AWS Simple Notification Service (SNS) platform or use Direct to Vendor services to add Firebase Cloud Messaging (FCM) and Apple Push Notification (APN) credentials directly in Auth0.

## AWS SNS Configuration

Before you configure push notifications, follow the prerequisites below:

1. [Create an SNS Platform Application](https://console.aws.amazon.com/sns/v3/home?region=us-east-1#/mobile/push-notifications/platform-applications) using AWS Management console and note it’s ARN.
2. Create an AWS Access Key ID authorized to create Platform Application endpoints. Guardian automatically creates a Platform Application endpoint with an appropriate device token as part of a successful enrollment.

### Configure push notifications with AWS SNS

To receive push notifications from Guardian, you first need to override Guardian's default SNS settings. Then, you can configure push notifications for Android and iOS.

1. On the Auth0 Dashboard, navigate to [Security > Multi-factor Auth](https://manage.auth0.com/#/security/mfa) and select **Push via Auth0 Guardian**. If the method is inactive, select the toggle at the top right to enable it.
2. Select **Custom** to reveal additional settings.
3. In the Push Notification Service section, choose **Amazon SNS.**

![Auth0 Dashboard > Security > Multi-factor Auth > Guardian > Custom > Amazon SNS](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/6PKSyH99GJ2CalJoG38sfZ/fbe7229dcc6f7d303a582520001b3dc1/Amazon_SNS.png)

1. In the Amazon SNS Configuration section, complete the following fields:

   | Field | Description |
   | - | - |
   | AWS Access Key ID | Your AWS Access Key ID. |
   | AWS Secret Access Key | Your AWS Secret Access Key. |
   | AWS Region | Your AWS application's region. |
2. Select **Save** to complete your changes.

## Configure push notifications for Android using FCM

> [tab] Get FCM credentials
>
> To configure Android push notifications on your Auth0 Dashboard, first retrieve your FCM server credentials. For full details, review Google's [Firebase documentation](https://firebase.google.com/docs/admin/setup#initialize-sdk).
>
> 1. Navigate to the Firebase Console and select your applicable project.
> 2. Open the **Settings** menu and choose **Service Accounts**.
> 3. Select **Generate New Private Key** to download your credential file.
>
> After you retrieve your credentials, you can configure push notifications on your Auth0 Dashboard.

> [tab] Configure Auth0 Dashboard
>
> After retrieving your credentials, you can configure Android push notifications from your Auth0 Dashboard.
>
> 1. Navigate to [Security > Multi-factor Auth](https://manage.auth0.com/#/guardian) and select **Push Notification using Auth0 Guardian**.
> 2. In the Push Notification App section, select **Custom** to reveal additional settings.
> 3. In the Android App Configuration section, configure the following:
>
>    | Setting | Description |
>    | - | - |
>    | Enable Android App | Allows Auth0 to send push notifications to your custom application. If this option is not enabled, push notifications cannot be sent. |
>    | Google Play Store URL | Provide a link to the custom application users must download to configure MFA. |
>    | FCM Server Credentials | Upload your [FCM server credentials](https://firebase.google.com/docs/admin/setup#initialize-sdk). |
> 4. Select **Save** to complete your changes.

## Configure push notifications for iOS using APNs

> [tab] Get and convert APN certificate
>
> To configure iOS push notifications on your Auth0 Dashboard, first retrieve your APN certificate and convert it to modern encryption.
>
> Keychain Access exports P12 files with legacy encryption (RC2 and Triple DES). Auth0 doesn't accept P12 files with legacy encryption, so you must convert the file to modern encryption (AES-256-CBC) before you upload it. You need OpenSSL 3.0 or later to convert the file. The `openssl` command included with macOS is LibreSSL, which doesn't support the options that the following steps use. On macOS, you can install OpenSSL with Homebrew:
>
> ```bash lines theme={null}
> brew install openssl
> ```
>
> 1. Generate a [new APN certificate](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns#2947597) from your Apple developer account. Choose the **Apple Push Notification service SSL (Sandbox & Production)** type. For development and testing only, you can choose **Apple Push Notification service SSL (Sandbox)** instead.
>
> 2. Install the certificate locally.
>
> 3. Find the certificate in Keychain Access. Its name depends on the certificate type:
>
>    * **Apple Push Notification service SSL (Sandbox & Production)**: `Apple Push Services: {AppId}`
>    * **Apple Push Notification service SSL (Sandbox)**: `Apple Sandbox Push Services: {AppId}`
>
> 4. Export the certificate and the associated private key to a P12 file (default name: `Certificates.p12`). When Keychain Access asks for a password to protect the exported items, leave the password empty.
>
> 5. Convert `Certificates.p12` to modern encryption. In a terminal, go to the folder that contains the file, and run the following commands:
>
>    1. Set the `OPENSSL` shell variable to the `openssl` command that Homebrew installed, so that the following commands don't use LibreSSL. If you installed OpenSSL 3.0 or later without Homebrew, use the full path to its `openssl` binary instead.
>
>       ```bash lines theme={null}
>       OPENSSL=$(brew --prefix openssl)/bin/openssl
>       # Without Homebrew: OPENSSL=$(which openssl)
>       $OPENSSL version
>       ```
>
>       The `$OPENSSL version` command shows your OpenSSL version. The output must show OpenSSL 3.0 or later, not LibreSSL.
>
>    2. Extract the certificate and the private key to an intermediate `apns.pem` file. OpenSSL needs the `-legacy` option to read the legacy encryption.
>
>       ```bash lines theme={null}
>       $OPENSSL pkcs12 -legacy -in Certificates.p12 -nodes -passin pass: -out apns.pem
>       ```
>
>    3. Create an `apns.p12` file with modern encryption and no password. The new file uses Password-Based Encryption Scheme 2 (PBES2) with AES-256-CBC and a SHA-256 message authentication code (MAC).
>
>       ```bash lines theme={null}
>       $OPENSSL pkcs12 -export -in apns.pem -out apns.p12 -passout pass: \
>         -keypbe AES-256-CBC -certpbe AES-256-CBC -macalg sha256
>       ```
>
>    4. Delete `apns.pem`, because it contains your unencrypted private key:
>
>       ```bash lines theme={null}
>       rm apns.pem
>       ```
>
> 6. Before you upload `apns.p12`, check its encryption. Run the following command in the same terminal session, so that the `OPENSSL` variable is still set:
>
>    ```bash lines theme={null}
>    $OPENSSL pkcs12 -in apns.p12 -info -noout -passin pass:
>    ```
>
>    Check the following three lines in the output:
>
>    1. The `MAC` line shows `sha256`.
>    2. The `PKCS7 Encrypted data` line, for the certificate, shows `PBES2, PBKDF2, AES-256-CBC`.
>    3. The `Shrouded Keybag` line, for the private key, shows `PBES2, PBKDF2, AES-256-CBC`.
>
>    The output should look similar to the following:
>
>    ```text theme={null}
>    MAC: sha256, Iteration 2048
>    MAC length: 32, salt length: 16
>    PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
>    Certificate bag
>    PKCS7 Data
>    Shrouded Keybag: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
>    ```
>
> 7. Delete `Certificates.p12`, and use `apns.p12` as the APN certificate in the Auth0 Dashboard.
>
>    To upload the certificate with the Auth0 Management API instead, encode `apns.p12` in base64:
>
>    ```bash lines theme={null}
>    base64 -i apns.p12 | tr -d '\n'
>    ```
>
>    Use the output as the `p12` value when you call the [Update APNS Configuration](/docs/docs/api/management/v2/guardian/put-apns) endpoint. This endpoint overwrites the whole APNs configuration, so also include the `bundle_id` and `sandbox` values. To get the current values, call the [Get APNS Push Notification Configuration](/docs/docs/api/management/v2/guardian/get-apns) endpoint.
>
> After you retrieve your credentials, you can configure push notifications on your Auth0 Dashboard.

> [tab] Configure Auth0 Dashboard
>
> After retrieving your credentials, you can configure iOS push notifications from your Auth0 Dashboard.
>
> 1. Navigate to [Security > Multi-factor Auth](https://manage.auth0.com/#/guardian) and select **Push Notification using Auth0 Guardian**.
> 2. In the Push Notification App section, select **Custom** to reveal additional settings.
> 3. In the iOS App Configuration section, configure the following:
>
>    | Field | Description |
>    | - | - |
>    | Enable iOS App | Allows Auth0 to send push notifications to your custom application. If this option is not enabled, push notifications cannot be sent. |
>    | Apple App Store URL | Provide a link to the custom application users must download to configure MFA. |
>    | APNs Bundle ID | Provided by iOS Developer Console. |
>    | APNs Certificate | Upload the converted `apns.p12` file. To create the file, follow the steps in **Get and convert APN certificate**. |
>    | iOS App Environment | Set this based on the configuration within your Apple developer account. |
> 4. Select **Save** to complete your changes.

## Learn more

* [Auth0 Guardian](/docs/docs/secure/multi-factor-authentication/auth0-guardian)
* [Guardian for Android SDK](/docs/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk)
* [Guardian.swift iOS SDK](/docs/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk)
* [Create Custom Enrollment Tickets](/docs/docs/secure/multi-factor-authentication/multi-factor-authentication-developer-resources/create-custom-enrollment-tickets)
* [Enroll and Challenge Push Authenticators](/docs/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa/enroll-and-challenge-push-authenticators)
