Using Auth0 Api-to-Api with Azure containers

I am deploying an ASP.NET Core 3.1 app in a Docker container running Linux. I am authenticating first with a “Regular Web Application” in Auth0, which works fine. Once the user has been authenticated the application then authenticates with an API app through Auth0, in order to get the data to show in the ASP.NET Core app. This second call to auth0 fails.

So, load site → authenticate with Auth0 → success → Authenticate with Auth0 machine to machine → failure.

If I run this outside of the Docker container, it works just fine. It is only running in the container that makes it break.

I get this error message inside the container:
Error from RemoteAuthentication: OpenIdConnectAuthenticationHandler: message.State is null or empty…

I have followed the Auth0 tutorial here: https://auth0.com/docs/quickstart/webapp/aspnet-owin/01-login#
I have also tried various other suggestions, but I always get that same error message.

Any help would be much appreciated. Are there knows bugs with Auth0 and Linux containers?

Anyone here that can offer any insights?