# Login by Auth0 WordPress plugin invalid state error

**URL:** <https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [September 19, 2024, 4:32pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564 "2024-09-19T16:32:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![malanciault](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/malanciault/32/51306_2.png) [@malanciault](https://community.auth0.com/u/malanciault)\
**Post date:** [September 19, 2024, 4:32pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/1 "2024-09-19T16:32:46Z")

</div>

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](https://xxxxx.eu.auth0.com/v2/logout?client_id=CO3Suv1OHsbT3GNu1bm1J1gc6FAhb2nN&returnTo=https%3A%2F%xxxxx.com%2Fwp-login.php)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/0/90d5cc1d899bc9e131e70edd61c3d7721697e60c.png)

Auth0 logs shows the user is properly authenticated:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/c/6cd22b38432e48cc52b45dcbb48e1cd8459e0287.png)

What am I missing 🙂

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 19, 2024, 7:24pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/3 "2024-09-19T19:24:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![malanciault](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/malanciault/32/51306_2.png) [@malanciault](https://community.auth0.com/u/malanciault)\
**Post date:** [September 19, 2024, 8:14pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/4 "2024-09-19T20:14:42Z")

</div>

> [@rueben.tiow](#):
>
> Rueben

Thanks Rueben,

Looks like the auth\_state cookie as a value of “deleted”:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/c/6c158c8a43909a324628f6541cdd0ec7af55b896.png)

Can you help ?

---

<div class="post-metadata">

**Author:** ![malanciault](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/malanciault/32/51306_2.png) [@malanciault](https://community.auth0.com/u/malanciault)\
**Post date:** [September 23, 2024, 12:34pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/5 "2024-09-23T12:34:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![malanciault](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/malanciault/32/51306_2.png) [@malanciault](https://community.auth0.com/u/malanciault)\
**Post date:** [September 26, 2024, 12:21pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/6 "2024-09-26T12:21:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 3, 2024, 7:01pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/7 "2024-10-03T19:01:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 17, 2024, 7:02pm UTC](https://community.auth0.com/t/login-by-auth0-wordpress-plugin-invalid-state-error/147564/8 "2024-10-17T19:02:05Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
