Help: server_error: Unable to issue redirect for OAuth 2.0 transaction

Figured out what the issue was.

My first working app was using v1 of auth0/auth0-react whereas my second was using v2, so this config which worked with v1 did not work in v2:

const auth0config = {
  domain: REACT_APP_AUTH0_ISSUER_URL,
  clientId: REACT_APP_AUTH0_CLIENT_ID,
  audience: REACT_APP_AUTH0_AUDIENCE,
  redirectUri: REACT_APP_AUTH0_REDIRECT_URI,
  scope: REACT_APP_AUTH0_SCOPES,
};

function Auth0Wrapper({ children }) {
  return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}

Instead, it should be:

const auth0config = {
  domain: REACT_APP_AUTH0_ISSUER_URL,
  clientId: REACT_APP_AUTH0_CLIENT_ID,
  authorizationParams: {
    audience: REACT_APP_AUTH0_AUDIENCE,
    redirect_uri: REACT_APP_AUTH0_REDIRECT_URI,
    scope: REACT_APP_AUTH0_SCOPES,
  }
};

function Auth0Wrapper({ children }) {
  return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}

I had not realized there breaking changes in the latest update (my mistake), but it would have been nice if there were more descriptive errors thrown - although maybe the error I received should have been enough to indicate that something was wrong with my configuration of redirect_uri.

v1 to v2 migration guide

1 Like