Auth0 Simulation for ephemeral deployments and reliable automated testing

Hi there,

My team at Frontside open-sourced an Auth0 Simulator earlier this month. It allows running a local or self-hosted version of the Auth0 service. One way to think about is as an Auth0 tenant that you can run anywhere.

We call it simulation instead of mock because, from the perspective of Auth0 SDKs, it looks like a real Auth0 service. It’s not designed to ever replace Auth0 because it doesn’t have any of the security guarantees that Auth0 provides, but it’s enough to make auth0.js believe that it’s talking to the real service. We created it to ease developer onboarding and make integration testing reliable on projects that use Auth0.

For local development, we start our simulation alongside the local development environment. We configure Auth0 Domain to http://localhost:3000 instead of devtenant.auth0.com. It gives us the ability to specify predefined user accounts without worrying about the configuration of the development Auth0 service. When it runs locally, it runs all of the same hooks/rules that we run in the production tenant.

For testing, we start the simulation along with the test application. When tests run, the app connects to localhost:3000. We never have to worry about our integration tests becoming out of sync with production or having to manually update our development tenant.

We run our Auth0 simulator in Kubernetes to allow deployed development apps to connect to the simulator without relying on a shared tenant account.

If you are interested in learning more, please checkout our blog post SIMPLIFIED LOCAL DEVELOPMENT AND TESTING WITH AUTH0 SIMULATION and @simulacrum/auth0-simulator on GitHub.

If you have a use case that it doesn’t support, let us know.

Feel free to ask any question you have.

Thank you,
Taras & Frontside team

Thanks a lot for outsourcing it and sharing it with the rest of community!

1 Like