Using a Backend Service for Native to Web Custom Token Exchange in Auth0

Overview

When generating a Native-to-Web Custom Token Exchange from a backend service rather than a native application, Auth0 requires the application type to be Native. Resolving this configuration conflict requires a dedicated Native application in Auth0 specifically for the Custom Token Exchange endpoints, while a separate Machine-to-Machine (M2M) or Regular Web Application handles other API calls. Additionally, the backend service must set the enforce_device_binding parameter to "none" to ensure the token functions correctly when passed to the end-user device.

Applies To

  • Auth0
  • Native to Web Custom Token Exchange
  • Backend Services
  • Token Generation
  • Device Binding

Solution

How is a backend service configured for Native to Web Custom Token Exchange?

Create a dedicated Native application in the Auth0 Dashboard for the CTE endpoints and configure the backend service to bypass device binding by following these steps:

  1. Navigate to the Auth0 Dashboard.
  2. Go to Applications and select Applications.
  3. Choose Create Application.
  4. Enter a descriptive name for the application.
  5. Select Native as the application type and choose Create.
  6. Navigate to the Settings tab of the newly created application.
  7. Locate the Client ID and Client Secret to use exclusively for the Native-to-Web CTE endpoints in the backend service.
  8. Configure the backend service to include the enforce_device_binding parameter set to "none" when making requests to the CTE endpoints.
  9. Create a separate Machine-to-Machine (M2M) or Regular Web Application in the Auth0 Dashboard to handle all other Auth0 API calls.

 

NOTE: The backend service must set enforce_device_binding to "none" because it generates the token on one device and passes it to the native application on a different device.

Recommended content

No recommended content found...