# The request contains an error: a0.invalid\_state

**URL:** <https://community.auth0.com/t/the-request-contains-an-error-a0-invalid-state/57936>\
**Category:** Get Help\
**Tags:** lock, login, auth0\
**Created:** [February 16, 2021, 12:58pm UTC](https://community.auth0.com/t/the-request-contains-an-error-a0-invalid-state/57936 "2021-02-16T12:58:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tadique.j](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tadique.j/32/14799_2.png) [@tadique.j](https://community.auth0.com/u/tadique.j)\
**Post date:** [February 16, 2021, 12:58pm UTC](https://community.auth0.com/t/the-request-contains-an-error-a0-invalid-state/57936/1 "2021-02-16T12:58:07Z")

</div>

Hello.

This issue occurred suddenly when I’m just normally logging in during my development. I’m using Java for Auth0. Can anyone help me for this one?

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

Thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 16, 2021, 9:37pm UTC](https://community.auth0.com/t/the-request-contains-an-error-a0-invalid-state/57936/3 "2021-02-16T21:37:22Z")

</div>

Hi @tadique.j,

Welcome back!

An invalid state error occurs when the `state` param returned by the auth server does not match the `state` initially sent by the application. This doc shows how it works.

> **[Prevent Attacks and Redirect Users with OAuth 2.0 State Parameters](https://auth0.com/docs/secure/attack-protection/state-parameters)**
>
> Describes how to use the state parameter in authentication requests to help prevent CSRF attacks and restore state

---

<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:** [April 27, 2021, 9:08pm UTC](https://community.auth0.com/t/the-request-contains-an-error-a0-invalid-state/57936/4 "2021-04-27T21:08:37Z")

</div>

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