How can I persist authentication across different applications and domains in a micro-frontend architecture?

Hi again

As mentioned in the onRedirectCallback documentation:

By default this removes the code and state parameters from the url when you are redirected from the authorize page. It uses window.history but you might want to overwrite this if you are using a custom router, like react-router-dom See the EXAMPLES.md for more info.

I believe that the state and code parameters are not being retrieved since it uses the default behaviour.
You might want to look into handleRedirectCallback which states:

After the browser redirects back to the callback page, call handleRedirectCallback to handle success and error responses from Auth0. If the response is successful, results will be valid according to their expiration times.

Parameters

  • Optional url: string

The URL to that should be used to retrieve the state and code values. Defaults to window.location.href if not given.

Otherwise, I would suggest to perform a silent authentication using getAccessTokenSilently after the user logs in using the embedded website.

Kind Regards,
Nik