App Login Fails with "Code exchange was unsuccessful; network error resulted in unfulfilled request"

Overview

When trying to login to an app, the following error is received:

Fatal error: Uncaught Auth0\SDK\Exception\StateException: Code exchange was unsuccessful; network error resulted in unfulfilled request…

Cause

An incorrect Client Secret on the remote server “.env” file.

Solution

  1. Run the Auth0 app locally. This will determine if there is an issue with the remote server.
  2. Confirm all settings in the server are correct.
  3. Check the client’s secret.