Unable to communicate between single page application and server

Hey there @arshsharma461 welcome to the community!

I have a hunch this is due to the lack of an audience param in access tokens. You’ll want to add it in your loginWithRedirect method:

const login = async () => {
  await auth0Client.loginWithRedirect({
    authorizationParams: {
      redirect_uri: window.location.origin,
      audience: "https://your-api-identifier"
    },
  });
};

The api identifier being that of the API you’ve registered in your dashboard:

1 Like