> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-docs-add-auth0-cli-management-api-examples.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Describes how to use universal links rather than custom URL schemes to verify the legitimacy of authentication data.

# Measures Against Application Impersonation

Native applications use the [Authorization Code Flow with PKCE](/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce) authentication flow and employ a `redirect_uri` to return control to the application after login. After the URI loads in the device’s browser, the application typically opens automatically to allow the user to continue their journey.

Historically, mobile application used [custom URI schemes](https://developers.google.com/identity/protocols/oauth2/native-app#installed_app_redirect_methods) (e.g., `com.mycompany.myapp://oauth2redirect`). However, custom URI schemes pose a risk as more than one application on the device can register the same scheme. Mobile OSs do not include built-in mechanisms to ensure the application receiving the redirect is the intended one. In this scenario, malicious apps impersonate legitimate ones and receive the authorization response (including tokens) without user awareness, especially if single sign-on (SSO) is active due to the existence of a previous legitimate session, in which additional user interaction is not required. PKCE doesn't really help in these scenarios, as the malicious application can initiate the login flow and wait to receive the callback without user interaction.

Applications running on a local machine (e.g., desktop apps, CLIs) use the loopback interface for callbacks (e.g., [http://127.0.0.1:51089/callback](http://127.0.0.1:51089/callback) or [http://localhost:61024/callback](http://localhost:61024/callback)) are similarly at risk. In this case, another application on the same machine could listen on the same port to intercept the response.

We refer to both custom URI schemes and loopback URIs as Non-Verifiable Callback URIs because the authorization server cannot verify the receiving application in either scenario.

## Recommended mitigations for mobile applications

### Claimed HTTPS URIs (Universal Links / App Links)

Modern mobile OSs support **claimed HTTPS URIs** allows you to associate a website domain you control with your mobile app. Claimed HTTPS URIs are known as:

* Universal Links on iOS
* App Links on Android

Claimed HTTPS URIs ensure only your application handles the associated callback URL and protects against unauthorized access to sensitive authentication data.

<Note>
  Auth0 **strongly recommends** using claimed HTTPS URIs as redirect URIs for all native applications.

  * For iOS: Review [Support Universal Links](https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content/#Support-universal-links).
  * For Android: Review [Android App Links](https://developer.android.com/training/app-links).
</Note>

## Recommended mitigations for all application

Auth0 cannot verify the legitimacy of the application receiving the authentication transaction results if:

* Your application is unable to support claimed HTTPS URIs due to required compatibility with older mobile OS versions
* Your application is a desktop or CLI application

As defined in the [OAuth2 for Native Apps](https://datatracker.ietf.org/doc/html/rfc8252#section-8.6) specification, Auth0 provides a mechanism to show a confirmation prompt to the user. Users confirm the application receiving the authentication result is the one they intended to access. When a non-verifiable callback URI is in use, the user is prompted to verify the application on each authentication transaction.

The confirmation screen displays when:

1. The `redirect_uri` present in the request uses a non-verifiable URI (i.e. a custom URI scheme or a loopback URI).
2. The user has not been prompted with any other screen in the current login transaction (such as when a [consent screen](/docs/get-started/applications/third-party-applications/user-consent-and-third-party-applications) populates for third-party applications, or when MFA is required).

In these cases, the application presents the end user with a confirmation prompt.

<Frame>
  <img src="https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/consent-pompt-uris.png?fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=3225cf0be9cbc8025c8c395a0c9f040e" alt="Measures Against App Impersonation - Confirmation Prompt" width="298" height="408" data-path="docs/images/cdy7uua7fh8z/consent-pompt-uris.png" />
</Frame>

The confirmation prompt is not shown in legacy non-OIDC-conformant flows. To learn how you can apply increased protection for your tenants and applications, review [Adopt OIDC-Conformant Authentication](/docs/authenticate/login/oidc-conformant-authentication).

#### Prompt customization

The confirmation prompt uses your custom branding and configurations defined for existing consent screens used for third-party applications. To learn more, review the Prompts section of [Customize Universal Login Page Templates](/docs/customize/login-pages/universal-login/customize-templates).

<Warning>
  Auth0 **strongly recommends** you do not disable this protection for production. Malicious applications on the device could request `id_tokens` and `access_tokens` without any interaction from the user or other indications that something has happened.
</Warning>

You can configure the confirmation prompt as a global tenant settings  or at the application-level. Application-level settings take precedence over the global tenant-level setting.

**Application-level**

1. [Navigate to Auth0 Dashboard > Applications > Application Settings > Advanced > OAuth](https://manage.auth0.com/#/applications/settings).
2. Scroll to the **Non-Verifiable Callback URI End-User Confirmation** setting.
3. Enable the toggle to activate the prompt or disable the toggle to deactivate the prompt.

<Frame>
  <img src="https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=ed257c91c130566ef7a08e4fe46773ba" alt="Auth0 Dashboard>Settings>Advanced" data-og-width="602" width="602" data-og-height="227" height="227" data-path="docs/images/cdy7uua7fh8z/custom-uri-override.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=280&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=cfac31db155c53021eb0dc064829432c 280w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=560&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=fea998d05d9bee66606ccbc6cf95edc6 560w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=840&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=b229111f3be98d8f38cadd1a6df964fa 840w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=1100&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=3d41e8486a89186004077c6fce576b23 1100w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=1650&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=10ff82108eac8d06e842357de61b021f 1650w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/custom-uri-override.png?w=2500&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=d275d9b72235030d15708c59557b90c7 2500w" />
</Frame>

**Global**

1. Navigate to [Auth0 Dashboard > Settings > Advanced](https://manage.auth0.com/#/tenant/advanced).
2. Find the **Non-Verifiable Callback URI End-User Confirmation** setting.
3. Enable the toggle to activate the prompt.

<Frame>
  <img src="https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=5a83e87438559bcaebc378c1db9aaa5c" alt="Auth0 Dashboard>Tenant Settings>Advanced>Skip Custom URI toggle" data-og-width="500" width="500" data-og-height="241" height="241" data-path="docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=280&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=18c4b9e913b0b19e58a41a764cb60c05 280w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=560&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=53f0eba929b475117606771e8358d64e 560w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=840&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=7e9fca3d80a2ff1d737e624b21224a71 840w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=1100&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=3da171fde6e3ca5f665f0e855fd3d1dc 1100w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=1650&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=dc8aa5a7164e0fff516203ced3c2369f 1650w, https://mintcdn.com/docs-staging-docs-add-auth0-cli-management-api-examples/ZOXamXKsxFiJUr1l/docs/images/cdy7uua7fh8z/enable-non-verifiable-callback.png?w=2500&fit=max&auto=format&n=ZOXamXKsxFiJUr1l&q=85&s=afda128623a3a9959acc914f3c85238a 2500w" />
</Frame>
