Login by Auth0 WordPress plugin invalid state error

Hi,

We have installed Login by Auth0 plugin (Version 4.6.2) on a WordPress site. The use case is as follow:

  • User wants to login on the WordPress site
  • User is redirected to Auth0 universal login
  • User is authenticated
  • User is redirected to WordPress and is now logged in

Everything is working but when the user is redirected to WordPress, he gets this error:

There was a problem with your log in: Invalid state [error code: unknown]

← Login

Auth0 logs shows the user is properly authenticated:

What am I missing :slight_smile:

Hi @malanciault,

The invalid state error occurs when the state parameter in the login request doesn’t match the one generated, stored, or validated during the login flow.

In this situation, I recommend checking your network activity to verify that the state parameter in the login request matches the one you get when you are redirected to the callback URL (redirect_uri).

Thanks,
Rueben

Thanks Rueben,

Looks like the auth_state cookie as a value of “deleted”:

Can you help ?

1 Like

Hi @rueben.tiow, any other tips ? Thanks!!

1 Like

Finally found the problem. Seems that the user we were trying to log with had been previously created on WordPress via another login plugin, which was causing a conflict. Closing this.

1 Like

Hi @malanciault,

Glad you were able to track down the issue!

Please reach out to us again if you have any further questions.

Thanks,
Rueben