mariovalney/laravel-keycloak-web-guard

[Keycloak Error] Invalid state

Closed this issue · 3 comments

After registration gives me this error:
Vizir\KeycloakWebGuard\Exceptions\KeycloakCallbackException
[Keycloak Error] Invalid state

Callback URL: http://127.0.0.1:8000/callback?state=0a3b6de9f1b51403fe6bdead4b014921&session_state=34041c3e-8261-44a0-9750-0c62b886f19f&code=230400b8-d80a-4291-91e1-9bf74a278221.34041c3e-8261-44a0-9750-0c62b886f19f.ae4487bd-8c09-4da4-aeeb-930d48b35e87

File: vendor\vizir\laravel-keycloak-web-guard\src\Controllers\AuthController.php:72

Help me solve this problem

Hi! State is a value persisted to ensure the continuous of the auth flow.
Check you are persisting it well.

Please check our README:
https://github.com/Vizir/laravel-keycloak-web-guard#where-the-accessrefresh-tokens-and-state-are-persisted

Привет! Состояние - это значение, которое сохраняется для обеспечения непрерывности потока аутентификации.
Убедитесь, что вы хорошо его сохраняете.

Пожалуйста, проверьте наш README:
https://github.com/Vizir/laravel-keycloak-web-guard#where-the-accessrefresh-tokens-and-state-are-persisted

Hey! I solved the problem! By adding KeycloakWeb::saveState(); to src/Controllers/AuthController.php in the register method after $url = KeycloakWeb::getRegisterUrl(); line:46 .

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.