E2e testing with Cypress + OpenIdConnect

Good morning,

We’re trying to setup e2e testing with Cypress and Auth0.

We’ve followed this guide for configuring Auth0 + writing Cypress JS (see attached):

So we’ve added a user with “Username-Password-Authentication” (which is not what we’re using in the normal auth flow). An invoke to the “Cypress” login gives a 200.

But then we get stuck with the callback process in our .NET Core website with OpenIdConnect. The examples we can find are more SPA implementations which rely on JavaScript.

The error we’re getting is:
“Message.state is null or empty”,

We’ve also found references to this error here: Auth0: Callback gives error "OpenIdConnectAuthenticationHandler: message.State is null or empty." · Issue #18528 · dotnet/aspnetcore · GitHub. But there is no conclusive way to solve the problem.

Does anyone have any pointers/input on how to invoke the callback to the server in the context of OpenIdConnect and ASP.NET Core.

Grt Chris


Some of the content of this other blog (An in-depth overview of writing Cypress end-to-end tests when using Auth0 – sandrino.dev) may be more relevant than the one you mentioned as this one seems to specifically consider traditional web applications and not just SPA’s.

1 Like

Thanks for sharing that Joao!