-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth0 Error: 'Invalid state' in /auth0/vendor/auth0/auth0-php/src/Auth0.php: line#537 #333
Comments
Hi @musaddiq-pk! This could be happening for a number of reasons. We have a few threads on our Community site that can help: https://community.auth0.com/t/invalid-state-php-error/17320/8 https://community.auth0.com/t/invalid-state-error-500-after-php-sdk-redirect/13895/ |
I have the same problem with SDK Version 5.4.0 from time to time.
|
@derMatze82 - I have no clue, that's very strange. Can you try catching a plain |
I have updated to 5.5, as I found out that this issue should be fixed there. |
Still happening in auth0 sdk 5.5, PHP 7.2:
Exception is not catchable in a try/catch block. Seems that the error appears in case of multiple browser-tabs open with the same page that includes the auth0 sdk |
I'm not sure what to say about that. You're either calling this in another place that's not being caught or there is something wrong with your The invalid state error itself might be related to running the auth process in two different tabs. If you start the auth in one tab and then start it in another and complete the first, there will be a mis-match in the values that we're storing in the PHP session |
@derMatze82 can you try updating your public function issue()
{
$state = $this->store->get(self::STATE_NAME);
if ($state === null) {
$state = uniqid('', true);
$this->store($state);
}
return $state;
} |
Thanks, I updated the code |
Still getting this error from time to time:
it's strange because in line 28:
But its not catched |
but your not getting the error all the time @derMatze82? |
@xaoseric No, only some users are facing this problem, most of the other users can login successfully |
@derMatze82 try clearing your laravel cache folder and session cache files for laravel. Ive seen it happen when a user deletes their account on the Auth0 side. |
I dont use any framework, it`s a self written PHP Application. Users cannot signup or delete account. |
I had this issue on an application that was available on two subdomains I solved this issue by setting php's cookie domain to |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello!
After searching for few hours I'm still struggling to fix the issue. Following error message is displayed on callback page.
Fatal error: Uncaught exception 'Auth0\SDK\Exception\CoreException' with message 'Invalid state' in auth0/vendor/auth0/auth0-php/src/Auth0.php:537
.Here is state value:
5ca21f797a9659.40872849
. And my test home page is https://www.casaskipito.com/auth0/.Any help will be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: